Author: jpobst
Date: 2007-07-16 15:32:09 -0400 (Mon, 16 Jul 2007)
New Revision: 82056

Modified:
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ButtonPainter.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
2007-07-16  Jonathan Pobst  <[EMAIL PROTECTED]>

        * ButtonPainter.cs: For flat buttons, draw mouse highlight when
        button is focused.  Remove random extra rectangle.

2007-07-16  Jonathan Pobst  <[EMAIL PROTECTED]>

        * ThemeWin32Classic.cs: Allow a Flat button to be Focused and Entered.
        Darken the focus color.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-07-16 18:56:28 UTC (rev 82055)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-07-16 19:32:09 UTC (rev 82056)
@@ -1,5 +1,10 @@
 2007-07-16  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * ThemeWin32Classic.cs: Allow a Flat button to be Focused and Entered.
+       Darken the focus color.
+
+2007-07-16  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * ListBox.cs: When measuring items, if it's a CheckedListBox, add room
        for the checkbox.
        * ThemeWin32Classic.cs: Make the checkbox bigger in a CheckedListBox 
and use

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-07-16 18:56:28 UTC (rev 82055)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-07-16 19:32:09 UTC (rev 82056)
@@ -227,8 +227,12 @@
                {
                        if (button.Pressed)
                                ThemeElements.DrawFlatButton (g, 
button.ClientRectangle, ButtonThemeState.Pressed, button.BackColor, 
button.ForeColor, button.FlatAppearance);
-                       else if (button.InternalSelected)
-                               ThemeElements.DrawFlatButton (g, 
button.ClientRectangle, ButtonThemeState.Default, button.BackColor, 
button.ForeColor, button.FlatAppearance);
+                       else if (button.InternalSelected) {
+                               if (button.Entered) 
+                                       ThemeElements.DrawFlatButton (g, 
button.ClientRectangle, ButtonThemeState.Default | ButtonThemeState.Entered, 
button.BackColor, button.ForeColor, button.FlatAppearance);
+                               else
+                                       ThemeElements.DrawFlatButton (g, 
button.ClientRectangle, ButtonThemeState.Default, button.BackColor, 
button.ForeColor, button.FlatAppearance);
+                       }
                        else if (button.Entered)
                                ThemeElements.DrawFlatButton (g, 
button.ClientRectangle, ButtonThemeState.Entered, button.BackColor, 
button.ForeColor, button.FlatAppearance);
                        else if (!button.Enabled)
@@ -240,7 +244,7 @@
                public virtual void DrawFlatButtonFocus (Graphics g, Button 
button)
                {
                        if (!button.Pressed) {
-                               Color focus_color = 
ControlPaint.Light(button.BackColor);
+                               Color focus_color = ControlPaint.Dark 
(button.BackColor);
                                g.DrawRectangle (ResPool.GetPen (focus_color), 
new Rectangle (button.ClientRectangle.Left + 4, button.ClientRectangle.Top + 4, 
button.ClientRectangle.Width - 9, button.ClientRectangle.Height - 9));
                        }
                }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ButtonPainter.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ButtonPainter.cs
 2007-07-16 18:56:28 UTC (rev 82055)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ButtonPainter.cs
 2007-07-16 19:32:09 UTC (rev 82056)
@@ -109,6 +109,7 @@
                                        // This will just use the BackColor
                                        break;
                                case ButtonThemeState.Entered:
+                               case ButtonThemeState.Default | 
ButtonThemeState.Entered:
                                        if (appearance.MouseOverBackColor != 
Color.Empty)
                                                g.FillRectangle 
(ResPool.GetSolidBrush (appearance.MouseOverBackColor), bounds);
                                        else
@@ -130,17 +131,12 @@
                                pen = is_themecolor ? 
SystemPens.ControlDarkDark : ResPool.GetSizedPen (cpcolor.DarkDark, 
appearance.BorderSize);
                        else
                                pen = ResPool.GetSizedPen 
(appearance.BorderColor, appearance.BorderSize);
-
-                               bounds.Width -= 1;
-                               bounds.Height -= 1;
                                
+                       bounds.Width -= 1;
+                       bounds.Height -= 1;
+                               
                        if (appearance.BorderSize > 0)
                                g.DrawRectangle (pen, bounds);
-                       
-                       if (state == ButtonThemeState.Default || state == 
ButtonThemeState.Pressed) {
-                               bounds.Inflate (-1, -1);
-                               g.DrawRectangle (pen, bounds);
-                       }
                }
                #endregion
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ChangeLog
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ChangeLog
        2007-07-16 18:56:28 UTC (rev 82055)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ChangeLog
        2007-07-16 19:32:09 UTC (rev 82056)
@@ -1,5 +1,10 @@
 2007-07-16  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * ButtonPainter.cs: For flat buttons, draw mouse highlight when
+       button is focused.  Remove random extra rectangle.
+
+2007-07-16  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * ButtonPainter.cs: For Flat button, if no mouse over / press
        backcolor is specified, calculate one from the normal backcolor.
 

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

Reply via email to