Skip to content

Commit

Permalink
Allow to set BackgroundColor of DocumentControl
Browse files Browse the repository at this point in the history
  • Loading branch information
ievgen-baida committed Feb 21, 2024
1 parent d0fd54b commit c198ebe
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class ThemedDocumentControlHandler : ThemedContainerHandler<TableLayout,
Panel contentPanel;
Font font;

Color backgroundColor;
Color disabledForegroundColor;
Color closeBackgroundColor;
Color closeHighlightBackgroundColor;
Expand Down Expand Up @@ -75,6 +76,17 @@ public Font Font
}
}

/// <inheritdoc />
public override Color BackgroundColor
{
get => backgroundColor;
set
{
backgroundColor = value;
tabDrawable.Invalidate();
}
}

/// <summary>
/// Gets or sets the disabled foreground color.
/// </summary>
Expand Down Expand Up @@ -229,6 +241,7 @@ public ThemedDocumentControlHandler()
nextPrevWidth = 0;
startx = 0;
font = SystemFonts.Default();
backgroundColor = SystemColors.Control;
disabledForegroundColor = SystemColors.DisabledText;
closeBackgroundColor = SystemColors.Control;
closeHighlightBackgroundColor = SystemColors.Highlight;
Expand Down Expand Up @@ -596,7 +609,7 @@ void Drawable_Paint(object sender, PaintEventArgs e)
{
var g = e.Graphics;

g.Clear(SystemColors.Control);
g.Clear(BackgroundColor);

var posx = nextPrevWidth + startx;

Expand Down

0 comments on commit c198ebe

Please sign in to comment.