Author: everaldo
Date: 2007-05-11 03:14:21 -0400 (Fri, 11 May 2007)
New Revision: 77197

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs
Log:
2007-05-11  Everaldo Canuto  <[EMAIL PROTECTED]>

        * ToolBar.cs: Fix button layour to best fit width or height according to
        vertical or not. Fixes #81524.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-11 06:10:12 UTC (rev 77196)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-11 07:14:21 UTC (rev 77197)
@@ -1,3 +1,8 @@
+2007-05-11  Everaldo Canuto  <[EMAIL PROTECTED]>
+
+       * ToolBar.cs: Fix button layour to best fit width or height according to
+       vertical or not. Fixes #81524.
+
 2007-05-10  Everaldo Canuto  <[EMAIL PROTECTED]>
 
        * ToolBarButton.cs: When change style call ToolBar.Redraw to update

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs       
2007-05-11 06:10:12 UTC (rev 77196)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs       
2007-05-11 07:14:21 UTC (rev 77197)
@@ -941,7 +941,7 @@
                                if (size_specified && (button.Style != 
ToolBarButtonStyle.Separator))
                                        changed = item.Layout (adjusted_size);
                                else
-                                       changed = item.Layout ();
+                                       changed = item.Layout (Vertical, 
calculated_size);
                                
                                bool is_separator = button.Style == 
ToolBarButtonStyle.Separator;
                                
@@ -1336,7 +1336,7 @@
                }
 
                
-               public bool Layout ()
+               public bool Layout (bool vertical, int calculated_size)
                {
                        if (toolbar == null || !button.Visible)
                                return false;
@@ -1345,8 +1345,14 @@
                        Size size = psize;
                        if ((!toolbar.SizeSpecified) || (button.Style == 
ToolBarButtonStyle.Separator)) {
                                size = CalculateSize ();
+
                                if (size.Width == 0 || size.Height == 0)
                                        size = psize;
+
+                               if (vertical)
+                                       size.Width = calculated_size;
+                               else
+                                       size.Height = calculated_size;
                        }
                        return Layout (size);
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to