2008-10-20 Jonathan Pobst <monkey@jpobst.com>
authorJonathan Pobst <monkey@jpobst.com>
Mon, 20 Oct 2008 22:00:05 +0000 (22:00 -0000)
committerJonathan Pobst <monkey@jpobst.com>
Mon, 20 Oct 2008 22:00:05 +0000 (22:00 -0000)
* ToolStripProfessionalRenderer.cs: Don't paint over a set BackgroundImage.

2008-10-20  Jonathan Pobst  <monkey@jpobst.com>

* ToolStripPainter.cs: Don't paint over a set BackgroundImage.

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

mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/Default/ToolStripPainter.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/VisualStyles/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms.Theming/VisualStyles/ToolStripPainter.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripProfessionalRenderer.cs

index c92fec2ad87d458b4557e36b29cfaf0034b9351d..5db05cb7e9873e57e54401b0b60a2c886583ea59 100644 (file)
-2008-10-09  Everaldo Canuto  <ecanuto@novell.com>
-
-       * LinkLabelPainter.cs: Take Padding into account when drawing the linklabel
-       text.
-
-2008-10-08  Everaldo Canuto  <ecanuto@novell.com>
-
-       * LabelPainter.cs: Use control.PaddingClientRectangle instead of calculate
-       rectangle with padding. Also break some lines that theres more than 120
-       characters.
-
-2008-09-24  Jonathan Pobst  <monkey@jpobst.com>
-
-       * TabControlPainter.cs: Add 1 pixel to the tab text rectangle
-       to keep the text from getting cut off on XP.
-       [Fixes bug #428116]
-
-2008-09-16  Jonathan Pobst  <monkey@jpobst.com>
-
-       * TabControlPainter.cs: Hook tab painting into ShowFocusCues.
-
-2008-07-31  George Giolfan  <georgegiolfan@yahoo.com>
-
-       * TabControlPainter.cs: Added DrawScrollButton, GetButtonState.
-
-2008-06-09  Carlos Alberto Cortez <calberto.cortez@gmail.com>
-
-       * TabControlPainter.cs: When calculating the display rectangle for
-       TabPage elements, don't include TabControlSelectedDelta.Y as part of
-       the page height, since it is only added ad the end (this is the way
-       it's done in TabControl). This way having a lot of pages with
-       Multiline as true doesn't add much extra space between the tab pages
-       labels and the actual tab pages area.
-       Fixes #393912.
-
-2008-05-21  George Giolfan <georgegiolfan@yahoo.com>
-
-       * TabControlPainter.cs: Added HasHotElementStyles.
-
-2008-05-19  George Giolfan <georgegiolfan@yahoo.com>
-
-       * TabControlPainter.cs: Refactored: Extracted DrawBackground.
-
-2008-05-16  Carlos Alberto Cortez <calberto.cortez@gmail.com>
-
-       * TabControlPainter.cs: Use HotPrefix.Show as the value of
-       StringFormat.HotPrefix when drawing the tab text.
-       Fixes #355193.
-
-2008-05-16  Carlos Alberto Cortez <calberto.cortez@gmail.com>
-
-       * TabControlPainter.cs: Use StringAlignment.Near as the value for
-       StringFormat.Alignment when drawing the tab text.
-       Fixes part of #352399.
-
-2008-02-25  Jonathan Pobst  <monkey@jpobst.com>
-
-       * LabelPainter.cs: Take Padding into account when drawing
-       the label text.
-
-2008-01-23  Everaldo Canuto  <ecanuto@novell.com>
-
-       * LabelPainter.cs: Added.
-
-2008-01-22  Everaldo Canuto  <ecanuto@novell.com>
-
-       * LinkLabelPainter.cs: Change Draw method to virtual.
-
-2008-01-22  Everaldo Canuto  <ecanuto@novell.com>
-
-       * LinkLabelPainter.cs: Added.
-
-2007-09-04  Everaldo Canuto  <everaldo@simios.org>
-
-       * CheckBoxPainter.cs: Adjust checkbox light color to ControlLightLight to
-       mimic win32 look. Fixes #82656 (2.0).
-
-2007-08-28  Jonathan Pobst  <monkey@jpobst.com>
-
-       * RadioButtonPainter.cs: Added.
-
-2007-08-22  Jonathan Pobst  <monkey@jpobst.com>
-
-       * CheckBoxPainter.cs: Added.
-
-2007-08-19  Everaldo Canuto  <ecanuto@novell.com>
-
-       * TabControlPainter.cs: Fix regression in default padding x.
-
-2007-08-19  Everaldo Canuto  <ecanuto@novell.com>
-
-       * TabControlPainter.cs: Fix border thickness, padding and tab text format to 
-       be horizontal centralized. Fixes #82471.
-
-2007-08-18  Everaldo Canuto  <ecanuto@novell.com>
-
-       * TabControlPainter.cs: Remove one vertical pixel from tab drawing, the 
-       bottom line was one pixel more than needed.
-
-2007-07-26  Everaldo Canuto  <ecanuto@novell.com>
-
-       * TabControlPainter.cs: Adjust vertical image position on tab. Fixes #81837.
-
-2007-07-26  Everaldo Canuto  <ecanuto@novell.com>
-
-       * TabControlPainter.cs: Uses str_rect to draw text since it take in account
-       the image size. Fixes #81836.
-
-2007-07-20  Jonathan Pobst  <monkey@jpobst.com>
-
-       * ToolStripPainter.cs: Patch from Rolf.  We weren't painting a
-       Checked button as sunken.  [Fixes bug #82151]
-
-2007-07-16  Jonathan Pobst  <monkey@jpobst.com>
-
-       * ButtonPainter.cs: For flat buttons, draw mouse highlight when
-       button is focused.  Remove random extra rectangle.
-
-2007-07-16  Jonathan Pobst  <monkey@jpobst.com>
-
-       * ButtonPainter.cs: For Flat button, if no mouse over / press
-       backcolor is specified, calculate one from the normal backcolor.
-
-2007-07-12  Jonathan Pobst  <monkey@jpobst.com>
-
-       * ButtonPainter.cs: For Flat button, if BorderSize is 0, don't
-       draw the rectangle.  Setting the pen's width to 1 isn't good
-       enough, it still draws the border.  [Fixes bug #82081]
-
-2007-07-03  Jonathan Pobst  <monkey@jpobst.com>
-
-       * ToolStripPainter.cs: Added. This is where we paint toolstrips
-       using the ToolStripSystemRenderer.
-
-2007-05-04  Andreia Gaita  <avidigal@novell.com>
-
-       * TabControlPainter.cs: Use ControlPaint static methods
-       instead of ThemeEngine ones (seeing as they're there and
-       all :p )
-
-2007-04-15  Andreia Gaita  <avidigal@novell.com>
-
-       * ButtonPainter.cs: refactoring of the button drawing
-       that was originally located in ThemeElementsDefault
-       
-       * TabControlPainter.cs: refactoring of the tabcontrol
-       drawing code originally located in the ThemeWin32Classic.
-       Also, fixes and changes:
-               - replaced most hardcoded values with properties to 
-               make it easier to customize implementations.
-               - fixed left and right alignment drawing problems
-               - fixed flatbutton border drawing on left and
-               right alignment
-               - fixed #79619
-               - fixed paddings, spacings and positioning.
-
-       
+2008-10-20  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * ToolStripPainter.cs: Don't paint over a set BackgroundImage.\r
+\r
+2008-10-09  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * LinkLabelPainter.cs: Take Padding into account when drawing the linklabel\r
+       text.\r
+\r
+2008-10-08  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * LabelPainter.cs: Use control.PaddingClientRectangle instead of calculate\r
+       rectangle with padding. Also break some lines that theres more than 120\r
+       characters.\r
+\r
+2008-09-24  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * TabControlPainter.cs: Add 1 pixel to the tab text rectangle\r
+       to keep the text from getting cut off on XP.\r
+       [Fixes bug #428116]\r
+\r
+2008-09-16  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * TabControlPainter.cs: Hook tab painting into ShowFocusCues.\r
+\r
+2008-07-31  George Giolfan  <georgegiolfan@yahoo.com>\r
+\r
+       * TabControlPainter.cs: Added DrawScrollButton, GetButtonState.\r
+\r
+2008-06-09  Carlos Alberto Cortez <calberto.cortez@gmail.com>\r
+\r
+       * TabControlPainter.cs: When calculating the display rectangle for\r
+       TabPage elements, don't include TabControlSelectedDelta.Y as part of\r
+       the page height, since it is only added ad the end (this is the way\r
+       it's done in TabControl). This way having a lot of pages with\r
+       Multiline as true doesn't add much extra space between the tab pages\r
+       labels and the actual tab pages area.\r
+       Fixes #393912.\r
+\r
+2008-05-21  George Giolfan <georgegiolfan@yahoo.com>\r
+\r
+       * TabControlPainter.cs: Added HasHotElementStyles.\r
+\r
+2008-05-19  George Giolfan <georgegiolfan@yahoo.com>\r
+\r
+       * TabControlPainter.cs: Refactored: Extracted DrawBackground.\r
+\r
+2008-05-16  Carlos Alberto Cortez <calberto.cortez@gmail.com>\r
+\r
+       * TabControlPainter.cs: Use HotPrefix.Show as the value of\r
+       StringFormat.HotPrefix when drawing the tab text.\r
+       Fixes #355193.\r
+\r
+2008-05-16  Carlos Alberto Cortez <calberto.cortez@gmail.com>\r
+\r
+       * TabControlPainter.cs: Use StringAlignment.Near as the value for\r
+       StringFormat.Alignment when drawing the tab text.\r
+       Fixes part of #352399.\r
+\r
+2008-02-25  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * LabelPainter.cs: Take Padding into account when drawing\r
+       the label text.\r
+\r
+2008-01-23  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * LabelPainter.cs: Added.\r
+\r
+2008-01-22  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * LinkLabelPainter.cs: Change Draw method to virtual.\r
+\r
+2008-01-22  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * LinkLabelPainter.cs: Added.\r
+\r
+2007-09-04  Everaldo Canuto  <everaldo@simios.org>\r
+\r
+       * CheckBoxPainter.cs: Adjust checkbox light color to ControlLightLight to\r
+       mimic win32 look. Fixes #82656 (2.0).\r
+\r
+2007-08-28  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * RadioButtonPainter.cs: Added.\r
+\r
+2007-08-22  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * CheckBoxPainter.cs: Added.\r
+\r
+2007-08-19  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * TabControlPainter.cs: Fix regression in default padding x.\r
+\r
+2007-08-19  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * TabControlPainter.cs: Fix border thickness, padding and tab text format to \r
+       be horizontal centralized. Fixes #82471.\r
+\r
+2007-08-18  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * TabControlPainter.cs: Remove one vertical pixel from tab drawing, the \r
+       bottom line was one pixel more than needed.\r
+\r
+2007-07-26  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * TabControlPainter.cs: Adjust vertical image position on tab. Fixes #81837.\r
+\r
+2007-07-26  Everaldo Canuto  <ecanuto@novell.com>\r
+\r
+       * TabControlPainter.cs: Uses str_rect to draw text since it take in account\r
+       the image size. Fixes #81836.\r
+\r
+2007-07-20  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * ToolStripPainter.cs: Patch from Rolf.  We weren't painting a\r
+       Checked button as sunken.  [Fixes bug #82151]\r
+\r
+2007-07-16  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * ButtonPainter.cs: For flat buttons, draw mouse highlight when\r
+       button is focused.  Remove random extra rectangle.\r
+\r
+2007-07-16  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * ButtonPainter.cs: For Flat button, if no mouse over / press\r
+       backcolor is specified, calculate one from the normal backcolor.\r
+\r
+2007-07-12  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * ButtonPainter.cs: For Flat button, if BorderSize is 0, don't\r
+       draw the rectangle.  Setting the pen's width to 1 isn't good\r
+       enough, it still draws the border.  [Fixes bug #82081]\r
+\r
+2007-07-03  Jonathan Pobst  <monkey@jpobst.com>\r
+\r
+       * ToolStripPainter.cs: Added. This is where we paint toolstrips\r
+       using the ToolStripSystemRenderer.\r
+\r
+2007-05-04  Andreia Gaita  <avidigal@novell.com>\r
+\r
+       * TabControlPainter.cs: Use ControlPaint static methods\r
+       instead of ThemeEngine ones (seeing as they're there and\r
+       all :p )\r
+\r
+2007-04-15  Andreia Gaita  <avidigal@novell.com>\r
+\r
+       * ButtonPainter.cs: refactoring of the button drawing\r
+       that was originally located in ThemeElementsDefault\r
+       \r
+       * TabControlPainter.cs: refactoring of the tabcontrol\r
+       drawing code originally located in the ThemeWin32Classic.\r
+       Also, fixes and changes:\r
+               - replaced most hardcoded values with properties to \r
+               make it easier to customize implementations.\r
+               - fixed left and right alignment drawing problems\r
+               - fixed flatbutton border drawing on left and\r
+               right alignment\r
+               - fixed #79619\r
+               - fixed paddings, spacings and positioning.\r
+\r
+       \r
index 6434e20578120ef136baaaed6c6c6ed189c85d55..7c9471ba5aafd12d9c796cccd8b0cba98c660b07 100644 (file)
@@ -166,7 +166,8 @@ namespace System.Windows.Forms.Theming.Default
 \r
                public virtual void OnRenderToolStripBackground (ToolStripRenderEventArgs e)\r
                {\r
-                       e.Graphics.Clear (e.BackColor);\r
+                       if (e.ToolStrip.BackgroundImage == null)\r
+                               e.Graphics.Clear (e.BackColor);\r
 \r
                        if (e.ToolStrip is StatusStrip)\r
                                e.Graphics.DrawLine (Pens.White, e.AffectedBounds.Left, e.AffectedBounds.Top, e.AffectedBounds.Right, e.AffectedBounds.Top);\r
index 5eb6fe29e238a3d6470731f04cc97bbe14833e38..3d0055af6e8fc676aa89b4e941845d4bb330a31d 100644 (file)
@@ -1,3 +1,7 @@
+2008-10-20  Jonathan Pobst  <monkey@jpobst.com>
+
+       * ToolStripPainter.cs: Don't paint over a set BackgroundImage.
+
 2008-09-16  Jonathan Pobst  <monkey@jpobst.com>
 
        * TabControlPainter.cs: Hook tab painting into ShowFocusCues.
index b10d67554d3928adaec87169f68c9fb3de58d942..25ce31a31dc2ce0f4f3a116e78341b5535121fdc 100644 (file)
@@ -192,6 +192,9 @@ namespace System.Windows.Forms.Theming.VisualStyles
                }
                public override void OnRenderToolStripBackground (ToolStripRenderEventArgs e)
                {
+                       if (e.ToolStrip.BackgroundImage != null)
+                               return;
+                               
                        if (!ThemeVisualStyles.RenderClientAreas) {
                                base.OnRenderToolStripBackground (e);
                                return;
index a82e961fc593456f5d38c77bad9623876fce906a..ee58d2f5388b4691b391e1ae7a21c2ced8954eff 100644 (file)
@@ -1,3 +1,7 @@
+2008-10-20  Jonathan Pobst  <monkey@jpobst.com>
+
+       * ToolStripProfessionalRenderer.cs: Don't paint over a set BackgroundImage.
+
 2008-10-20  Mario Carrion <mcarrion@novell.com>
 
        * ErrorProvider.cs, ToolTip.cs, HelpProvider.cs: UIA internal property 
index ae9355df5747cf1f2d1e0a2f9dcb34af1bfd7a9f..cebe7029a80e5223d5ff044604c32fbbec030e87 100644 (file)
@@ -362,6 +362,14 @@ namespace System.Windows.Forms
 
                protected override void OnRenderToolStripBackground (ToolStripRenderEventArgs e)
                {
+                       // Don't clear and fill the background if we already painted an image there
+                       if (e.ToolStrip.BackgroundImage != null) {
+                               if (e.ToolStrip is StatusStrip)
+                                       e.Graphics.DrawLine (Pens.White, e.AffectedBounds.Left, e.AffectedBounds.Top, e.AffectedBounds.Right, e.AffectedBounds.Top);
+                       
+                               return;
+                       }
+                               
                        if (e.ToolStrip is ToolStripDropDown) {
                                e.Graphics.Clear (this.ColorTable.ToolStripDropDownBackground);
                                return;