position expander in center of given rectangle

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2011-11-12 16:50:37 +00:00
parent 990cf3b959
commit 5ede3d24c8

View File

@@ -256,8 +256,7 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win,
if (win->GetLayoutDirection() == wxLayout_RightToLeft) if (win->GetLayoutDirection() == wxLayout_RightToLeft)
x_diff = rect.width; x_diff = rect.width;
// VZ: I don't know how to get the size of the expander so as to centre it // x and y parameters specify the center of the expander
// in the given rectangle, +2/3 below is just what looks good here...
gtk_paint_expander gtk_paint_expander
( (
gtk_widget_get_style(tree), gtk_widget_get_style(tree),
@@ -266,8 +265,8 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win,
NULL, NULL,
tree, tree,
"treeview", "treeview",
dc.LogicalToDeviceX(rect.x) + 6 - x_diff, dc.LogicalToDeviceX(rect.x) + rect.width / 2 - x_diff,
dc.LogicalToDeviceY(rect.y) + 3, dc.LogicalToDeviceY(rect.y) + rect.height / 2,
flags & wxCONTROL_EXPANDED ? GTK_EXPANDER_EXPANDED flags & wxCONTROL_EXPANDED ? GTK_EXPANDER_EXPANDED
: GTK_EXPANDER_COLLAPSED : GTK_EXPANDER_COLLAPSED
); );