aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine/UI/ClassicButton.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Histacom2.Engine/UI/ClassicButton.cs')
-rw-r--r--Histacom2.Engine/UI/ClassicButton.cs22
1 files changed, 16 insertions, 6 deletions
diff --git a/Histacom2.Engine/UI/ClassicButton.cs b/Histacom2.Engine/UI/ClassicButton.cs
index 1a77964..9b1db72 100644
--- a/Histacom2.Engine/UI/ClassicButton.cs
+++ b/Histacom2.Engine/UI/ClassicButton.cs
@@ -28,19 +28,17 @@ namespace Histacom2.Engine.UI
}
}
+ public bool AdaptForeColorWithTheme = true;
+ public bool AdaptFontWithTheme = true;
+
public ClassicButton() : base()
{
+
if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor;
else BackColor = Color.Silver;
_lightBack = ControlPaint.Light(BackColor, 50);
_darkBack = ControlPaint.Dark(BackColor, 50);
- if (SaveSystem.currentTheme != null) ForeColor = SaveSystem.currentTheme.threeDObjectsTextColor;
- else ForeColor = Color.Black;
-
- if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont;
- else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
-
MouseDown += (s, e) => { _pressing = true; Invalidate(); };
MouseUp += (s, e) => { _pressing = false; Invalidate(); };
Invalidate();
@@ -53,6 +51,18 @@ namespace Histacom2.Engine.UI
if (SaveSystem.currentTheme != null) BackColor = SaveSystem.currentTheme.threeDObjectsColor;
else BackColor = Color.Silver;
+ if (AdaptForeColorWithTheme)
+ {
+ if (SaveSystem.currentTheme != null) ForeColor = SaveSystem.currentTheme.threeDObjectsTextColor;
+ else ForeColor = Color.Black;
+ }
+
+ if (AdaptFontWithTheme)
+ {
+ if (SaveSystem.currentTheme != null) Font = SaveSystem.currentTheme.buttonFont;
+ else Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
+ }
+
_lightBack = Paintbrush.GetLightFromColor(BackColor);
_darkBack = Paintbrush.GetDarkFromColor(BackColor);