]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/renderer.cpp
implement wxChoicebook::SetWindowVariant() by forwarding it to wxChoice (see #10398)
[wxWidgets.git] / src / gtk / renderer.cpp
index a25541fe4c118406ac6f619fd009fd2647caaf34..177fb31036db1249cb1c2b91f82ce53007bc29c3 100644 (file)
@@ -525,6 +525,8 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
                                      const wxRect& rect,
                                      int flags )
 {
+    GtkWidget *tree = wxGTKPrivate::GetTreeWidget();
+    
     GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
     wxASSERT_MSG( gdk_window,
                   wxT("cannot use wxRendererNative on wxDC of this type") );
@@ -533,14 +535,15 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
     if (win->GetLayoutDirection() == wxLayout_RightToLeft)
         x_diff = rect.width;
 
-    GtkStateType state;
+    GtkStateType state = GTK_STATE_NORMAL;
+    
     if (flags & wxCONTROL_SELECTED)
     {
         // the wxCONTROL_FOCUSED state is deduced
         // directly from the m_wxwindow by GTK+
         state = GTK_STATE_SELECTED;
 
-        gtk_paint_flat_box( win->m_widget->style,
+        gtk_paint_flat_box( tree->style, // win->m_widget->style,
                         gdk_window,
                         state,
                         GTK_SHADOW_NONE,
@@ -559,7 +562,10 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
 
     if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED))
     {
-        gtk_paint_focus( win->m_widget->style,
+        if (flags & wxCONTROL_SELECTED)
+            state = GTK_STATE_SELECTED;
+            
+        gtk_paint_focus( tree->style,
                          gdk_window,
                          state,
                          NULL,
@@ -569,7 +575,7 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
                          // Using "treeview-middle" would fix the warning, but the right
                          // edge of the focus rect is not getting erased properly either.
                          // Better to not specify this detail unless the drawing is fixed.
-                         NULL,
+                         "",
                          dc.LogicalToDeviceX(rect.x),
                          dc.LogicalToDeviceY(rect.y),
                          rect.width,