2008-07-11 George Giolfan <georgegiolfan@yahoo.com>
authorGeorge Giolfan <ggiolfan@mono-cvs.ximian.com>
Fri, 11 Jul 2008 19:09:04 +0000 (19:09 -0000)
committerGeorge Giolfan <ggiolfan@mono-cvs.ximian.com>
Fri, 11 Jul 2008 19:09:04 +0000 (19:09 -0000)
* InternalWindowManager.cs: HandleSizing: Implemented a better minimum
tracking size for tool windows.
* Theme.cs, ThemeWin32Classic.cs : Extracted
ManagedWindowSpacingAfterLastTitleButton.

svn path=/trunk/mcs/; revision=107750

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

index 6631324accabaacc5ac331634ee2503ea9adce42..c74f1e6cb19970f68d563e28a854b64ca4391418 100644 (file)
@@ -1,3 +1,10 @@
+2008-07-11  George Giolfan  <georgegiolfan@yahoo.com>
+
+       * InternalWindowManager.cs: HandleSizing: Implemented a better minimum
+       tracking size for tool windows.
+       * Theme.cs, ThemeWin32Classic.cs : Extracted
+       ManagedWindowSpacingAfterLastTitleButton.
+
 2008-07-11  Jonathan Pobst  <monkey@jpobst.com>
 
        * ThemeEngine.cs: Remove the clearlooks, nice, and old gtk themes.
index db0313a2dc0ab6c098e9d9b1ee31c506c94b3e5f..254a1ba4442d2488b93d2a06e1c8a01e540f8519 100644 (file)
@@ -642,9 +642,17 @@ namespace System.Windows.Forms {
                private void HandleSizing (Message m)
                {
                        Rectangle pos = virtual_position;
-                       Size minimum_size = SystemInformation.MinWindowTrackSize;
-                       int mw = minimum_size.Width;
-                       int mh = minimum_size.Height;
+                       int mw;
+                       int mh;
+                       if (IsToolWindow) {
+                               int border_width = BorderWidth;
+                               mw = 2 * (border_width + Theme.ManagedWindowSpacingAfterLastTitleButton) + ThemeEngine.Current.ManagedWindowButtonSize (this).Width;
+                               mh = 2 * border_width + TitleBarHeight;
+                       } else {
+                               Size minimum_size = SystemInformation.MinWindowTrackSize;
+                               mw = minimum_size.Width;
+                               mh = minimum_size.Height;
+                       }
                        int x = Cursor.Position.X;
                        int y = Cursor.Position.Y;
 
index 87a4d63caeed4685123adbf987b55bc63707693c..914db25aa14f5d00ebe2b11dac952d15fd29e872 100644 (file)
@@ -1028,6 +1028,7 @@ namespace System.Windows.Forms
                public abstract bool ManagedWindowTitleButtonHasHotElementStyle (TitleButton button, Form form);
                public abstract void ManagedWindowDrawMenuButton (Graphics dc, TitleButton button, Rectangle clip, InternalWindowManager wm);
                public abstract void ManagedWindowOnSizeInitializedOrChanged (Form form);
+               public const int ManagedWindowSpacingAfterLastTitleButton = 2;
                #endregion
 
                #region ControlPaint Methods
index 80e3c570cbf3c68ebd5773bdeea9e7b124d9076a..17cfdbfbf0e60e7f16b1838813e43b32b20acc2e 100644 (file)
@@ -6146,7 +6146,7 @@ namespace System.Windows.Forms
                        int btw = btsize.Width;
                        int bth = btsize.Height;
                        int top = bw + 2;
-                       int left = form.Width - bw - btw - 2;
+                       int left = form.Width - bw - btw - ManagedWindowSpacingAfterLastTitleButton;
                        
                        if ((!wm.IsToolWindow || wm.IsMinimized) && wm.HasBorders) {
                                buttons.CloseButton.Rectangle = new Rectangle (left, top, btw, bth);