X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c85ab7569677ff535c258c7f25ad428ba1ed406..5875d39c9ba19f518e691792524f2fd03261c825:/src/gtk1/renderer.cpp diff --git a/src/gtk1/renderer.cpp b/src/gtk1/renderer.cpp index 8b545e1c39..7c0a375e80 100644 --- a/src/gtk1/renderer.cpp +++ b/src/gtk1/renderer.cpp @@ -42,6 +42,11 @@ #define WXUNUSED_IN_GTK1(arg) #endif +// RR: After a correction to the orientation of the sash +// this doesn't seem to be required anymore and it +// seems to confuse some themes so USE_ERASE_RECT=0 +#define USE_ERASE_RECT 0 + // ---------------------------------------------------------------------------- // wxRendererGTK: our wxRendererNative implementation // ---------------------------------------------------------------------------- @@ -196,7 +201,7 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win, state = GTK_STATE_PRELIGHT; else state = GTK_STATE_NORMAL; - + // VZ: I don't know how to get the size of the expander so as to centre it // in the given rectangle, +2/3 below is just what looks good here... gtk_paint_expander @@ -237,7 +242,7 @@ static int GetGtkSplitterFullSize() gint handle_size; gtk_widget_style_get (s_paned, "handle_size", &handle_size, NULL); - + return handle_size; #else return SASH_SIZE + SASH_MARGIN; @@ -282,14 +287,17 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win, // window not realized yet return; } - + wxCoord full_size = GetGtkSplitterFullSize(); // are we drawing vertical or horizontal splitter? const bool isVert = orient == wxVERTICAL; GdkRectangle rect; +#if USE_ERASE_RECT GdkRectangle erase_rect; +#endif + if ( isVert ) { int h = win->GetClientSize().GetHeight(); @@ -299,10 +307,12 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win, rect.width = full_size; rect.height = h; +#if USE_ERASE_RECT erase_rect.x = position; erase_rect.y = 0; erase_rect.width = full_size; erase_rect.height = h; +#endif } else // horz { @@ -313,17 +323,15 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win, rect.height = full_size; rect.width = w; +#if USE_ERASE_RECT erase_rect.y = position; erase_rect.x = 0; erase_rect.height = full_size; erase_rect.width = w; +#endif } -#if 0 - // RR: After a correction to the orientation of the sash - // this doesn't seem to be required anymore and it - // seems to confuse some themes - +#if USE_ERASE_RECT // we must erase everything first, otherwise the garbage // from the old sash is left when dragging it gtk_paint_flat_box @@ -430,10 +438,12 @@ wxRendererGTK::DrawDropArrow(wxWindow *win, GtkStateType state; - if ( flags & wxCONTROL_CURRENT ) - state = GTK_STATE_PRELIGHT; + if ( flags & wxCONTROL_PRESSED ) + state = GTK_STATE_ACTIVE; else if ( flags & wxCONTROL_DISABLED ) state = GTK_STATE_INSENSITIVE; + else if ( flags & wxCONTROL_CURRENT ) + state = GTK_STATE_PRELIGHT; else state = GTK_STATE_NORMAL; @@ -471,10 +481,12 @@ wxRendererGTK::DrawComboBoxDropButton(wxWindow *win, // draw button GtkStateType state; - if ( flags & wxCONTROL_CURRENT ) - state = GTK_STATE_PRELIGHT; + if ( flags & wxCONTROL_PRESSED ) + state = GTK_STATE_ACTIVE; else if ( flags & wxCONTROL_DISABLED ) state = GTK_STATE_INSENSITIVE; + else if ( flags & wxCONTROL_CURRENT ) + state = GTK_STATE_PRELIGHT; else state = GTK_STATE_NORMAL;