Skip to content

Commit ddbf07f

Browse files
committed
fixed ForeColor in FileDialog for displaying additional files info;
1 parent 1fa323a commit ddbf07f

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

System/Windows/Forms/Control.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,9 @@ protected virtual void OnMouseWheel(MouseEventArgs e)
898898
protected virtual void OnPaint(PaintEventArgs e)
899899
{
900900
}
901-
protected virtual void OnPaintBackground(PaintEventArgs pevent)
901+
protected virtual void OnPaintBackground(PaintEventArgs e)
902902
{
903-
PaintBackground(pevent, ClientRectangle);
903+
PaintBackground(e, ClientRectangle);
904904
}
905905
protected virtual void OnParentChanged(EventArgs e)
906906
{

System/Windows/Forms/FileDialog.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,11 +574,15 @@ protected override void OnDrawNode(DrawTreeNodeEventArgs e)
574574
var fInfo = info.Info;
575575
if (fInfo == null)
576576
return;
577+
578+
var foreColor = e.Node.ForeColor;
579+
if (foreColor.IsEmpty)
580+
foreColor = ForeColor;
577581

578582
e.Graphics.uwfDrawString(
579583
fInfo.LastWriteTime.ToString("dd.MM.yyyy HH:mm"),
580584
Font,
581-
e.Node.ForeColor,
585+
foreColor,
582586
selectionBounds.X + 440,
583587
selectionBounds.Y,
584588
200,
@@ -587,7 +591,7 @@ protected override void OnDrawNode(DrawTreeNodeEventArgs e)
587591
e.Graphics.uwfDrawString(
588592
info.sizeStr,
589593
Font,
590-
e.Node.ForeColor,
594+
foreColor,
591595
selectionBounds.X + 400,
592596
selectionBounds.Y,
593597
selectionBounds.Width - 412,

System/Windows/Forms/Form.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,8 @@ protected override void OnMouseMove(MouseEventArgs e)
575575
}
576576
protected override void OnPaint(PaintEventArgs e)
577577
{
578-
var g = e.Graphics;
579-
var headerHeight = uwfHeaderHeight;
580-
var width = Width;
581-
582578
// Background color.
583-
g.uwfFillRectangle(BackColor, 0, headerHeight, width, Height - headerHeight);
579+
e.Graphics.uwfFillRectangle(BackColor, 0, uwfHeaderHeight, Width, Height - uwfHeaderHeight);
584580
}
585581
protected virtual void OnShown(EventArgs e)
586582
{
@@ -608,11 +604,7 @@ protected override void OnVisibleChanged(EventArgs e)
608604

609605
base.OnVisibleChanged(e);
610606
}
611-
protected override void SetBoundsCore(int newX, int newY, int newWidth, int newHeight, BoundsSpecified specified)
612-
{
613-
base.SetBoundsCore(newX, newY, newWidth, newHeight, specified);
614-
}
615-
607+
616608
private void DrawShadow(PaintEventArgs e)
617609
{
618610
var loc = uwfShadowPointToScreen(Location);

0 commit comments

Comments
 (0)