Skip to content

Commit

Permalink
* StatusBar.cs: Statusbar handles its fore/back colours on it's
Browse files Browse the repository at this point in the history
        on. Because thats how it rolls. (and this avoids it using
        ambient
        colours).
        * ThemeWin32Classic.cs: Use the proper back color for filling.


svn path=/trunk/mcs/; revision=54715
  • Loading branch information
Jackson Harper committed Dec 22, 2005
1 parent 0a59f6e commit ec63f04
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
@@ -1,3 +1,10 @@
2005-12-21 Jackson Harper <jackson@ximian.com>

* StatusBar.cs: Statusbar handles its fore/back colours on it's
on. Because thats how it rolls. (and this avoids it using ambient
colours).
* ThemeWin32Classic.cs: Use the proper back color for filling.

2005-12-21 Alexander Olk <alex.olk@googlemail.com>

* ColorDialog.cs: Fixed a memory leak that caused a SIGSEV. A lot of
Expand Down
14 changes: 10 additions & 4 deletions mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs
Expand Up @@ -42,6 +42,9 @@ public class StatusBar : Control {
#region Fields
private StatusBarPanelCollection panels;

private Color back_color;
private Color fore_color;

private bool show_panels = false;
private bool sizing_grip = true;

Expand All @@ -52,6 +55,8 @@ public class StatusBar : Control {
public StatusBar ()
{
base.Dock = DockStyle.Bottom;
back_color = SystemColors.Control;
fore_color = SystemColors.ControlText;
Anchor = AnchorStyles.Top | AnchorStyles.Left;
this.TabStop = false;
this.SetStyle(ControlStyles.UserPaint | ControlStyles.Selectable, false);
Expand All @@ -62,11 +67,11 @@ public StatusBar ()
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override Color BackColor {
get { return base.BackColor; }
get { return back_color; }
set {
if (value == BackColor)
return;
base.BackColor = value;
back_color = value;
if (BackColorChanged != null)
BackColorChanged (this, EventArgs.Empty);
Update ();
Expand Down Expand Up @@ -112,10 +117,11 @@ public StatusBar ()
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override Color ForeColor {
get { return base.ForeColor; }
get { return fore_color; }
set {
if (value == ForeColor)
return;
fore_color = value;
if (ForeColorChanged != null)
ForeColorChanged (this, EventArgs.Empty);
Update ();
Expand Down Expand Up @@ -272,7 +278,7 @@ protected override void OnResize (EventArgs e)
if (Width <= 0 || Height <= 0)
return;

CalcPanelSizes ();
Update ();
}

protected override void WndProc(ref Message m) {
Expand Down
Expand Up @@ -3178,7 +3178,7 @@ protected virtual void ScrollBar_Horizontal_Draw_ThumbMoving_Backwards( int scro
Border3DStyle border_style = Border3DStyle.SunkenInner;
if (panel.BorderStyle == StatusBarPanelBorderStyle.Raised)
border_style = Border3DStyle.RaisedOuter;
CPDrawBorder3D(dc, area, border_style, Border3DSide.All, ColorControl);
CPDrawBorder3D(dc, area, border_style, Border3DSide.All, panel.Parent.BackColor);
}

if (panel.Style == StatusBarPanelStyle.OwnerDraw) {
Expand Down

0 comments on commit ec63f04

Please sign in to comment.