]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/renderer.cpp
Remove unnecessary base class OnPaint() call from wxGenericColourDialog.
[wxWidgets.git] / src / gtk / renderer.cpp
index 7834a390478568913e690f73d03691eabb1d856e..5f74edc88b778e4c7bdf3da1738fa983f5c589a7 100644 (file)
@@ -145,7 +145,7 @@ static GdkWindow* wxGetGdkWindowForDC(wxWindow* win, wxDC& dc)
     GdkWindow* gdk_window = NULL;
 
 #if wxUSE_GRAPHICS_CONTEXT
-    if ( dc.IsKindOf( CLASSINFO(wxGCDC) ) )
+    if ( wxDynamicCast(&dc, wxGCDC) )
         gdk_window = win->GTKGetDrawingWindow();
     else
 #endif
@@ -256,8 +256,7 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win,
     if (win->GetLayoutDirection() == wxLayout_RightToLeft)
         x_diff = rect.width;
 
-    // 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...
+    // x and y parameters specify the center of the expander
     gtk_paint_expander
     (
         gtk_widget_get_style(tree),
@@ -266,8 +265,8 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win,
         NULL,
         tree,
         "treeview",
-        dc.LogicalToDeviceX(rect.x) + 6 - x_diff,
-        dc.LogicalToDeviceY(rect.y) + 3,
+        dc.LogicalToDeviceX(rect.x) + rect.width / 2 - x_diff,
+        dc.LogicalToDeviceY(rect.y) + rect.height / 2,
         flags & wxCONTROL_EXPANDED ? GTK_EXPANDER_EXPANDED
                                    : GTK_EXPANDER_COLLAPSED
     );