X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/385e8575dd1f9219fb0e3f7fa26ffe4c24d2fdbb..be85a191e19ad0e702f4244d424fe7dd066a8f0c:/src/gtk/renderer.cpp?ds=sidebyside diff --git a/src/gtk/renderer.cpp b/src/gtk/renderer.cpp index 7834a39047..248c9f7c47 100644 --- a/src/gtk/renderer.cpp +++ b/src/gtk/renderer.cpp @@ -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 );