From: Julian Smart <julian@anthemion.co.uk>
Date: Tue, 23 Jul 2002 17:31:31 +0000 (+0000)
Subject: Applied patch [ 585436 ] motif toolbar control alignment fix
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/96c3039d9af7cfce8b3b5059186950119c0b325f

Applied patch [ 585436 ] motif toolbar control alignment fix


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp
index 03f2e08a9e..f62b739ad0 100644
--- a/src/motif/toolbar.cpp
+++ b/src/motif/toolbar.cpp
@@ -285,7 +285,10 @@ bool wxToolBar::Realize()
                 wxControl* control = tool->GetControl();
                 wxSize sz = control->GetSize();
                 wxPoint pos = control->GetPosition();
-                control->Move(currentX, pos.y);
+                // Allow a control to specify a y-offset by setting its initial position,
+                // but still don't allow it to position itself above the top margin.
+                int controlY = (pos.y > 0) ? currentY + pos.y : currentY;
+                control->Move(currentX, controlY);
                 currentX += sz.x + packing;
 
                 break;