]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/renderer.cpp
No changes, just minor wxMSW code cleanup: use WinStruct<>.
[wxWidgets.git] / src / gtk / renderer.cpp
index 7834a390478568913e690f73d03691eabb1d856e..248c9f7c470e2bc78e5c44e8eeb0ea352f7da03b 100644 (file)
@@ -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
     );