[Libreoffice-commits] .: Branch 'feature/layout' - vcl/source

Ricardo Cruz rpmcruz at kemper.freedesktop.org
Fri Dec 17 20:40:55 PST 2010


 vcl/source/layout/buttonbox.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 74fc8218785f44753115a69f5fd12babb8e2e64a
Author: Ricardo Cruz <rpmcruz at alunos.dcc.fc.up.pt>
Date:   Sat Dec 18 04:40:37 2010 +0000

    Added min button sizes to ButtonBox, like gtk does: disabled for now

diff --git a/vcl/source/layout/buttonbox.cxx b/vcl/source/layout/buttonbox.cxx
index 7b938b7..9f0d6eb 100644
--- a/vcl/source/layout/buttonbox.cxx
+++ b/vcl/source/layout/buttonbox.cxx
@@ -24,7 +24,14 @@
 #include <vcl/button.hxx>
 #include <vcl/buttonbox.hxx>
 
-#define SPACING 6
+#define SPACING 4
+#if 0  // minimum button sizes: default values used by GTK
+#define BUTTON_MIN_WIDTH  85
+#define BUTTON_MIN_HEIGHT 27
+#else
+#define BUTTON_MIN_WIDTH  0
+#define BUTTON_MIN_HEIGHT 0
+#endif
 
 // TODO: export order to plugins
 
@@ -128,6 +135,8 @@ Size ButtonBox::SizeRequest()
         Widget &button = it->button;
         if (button.IsVisible()) {
             Size childReq (button.SizeRequest());
+            childReq = Size (SAL_MAX (childReq.Width(), BUTTON_MIN_WIDTH),
+                SAL_MAX (childReq.Height(), BUTTON_MIN_HEIGHT));
             it->requisition = childReq;
 
             if (m_buttonOrder->UseSameSize())


More information about the Libreoffice-commits mailing list