mirror of
https://github.com/HistacomUnity/Histacom2-old.git
synced 2025-01-22 09:02:01 -05:00
windows now change theme immediately
This commit is contained in:
parent
859e2483cb
commit
410b793a8b
5 changed files with 34 additions and 4 deletions
|
@ -48,14 +48,17 @@ public static void ExtendedToolStripSeparator_Paint(object sender, PaintEventArg
|
|||
|
||||
public static Color GetLightFromColor(Color basecolor)
|
||||
{
|
||||
if (basecolor == Color.Silver) return Color.White;
|
||||
if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(184, 184, 184);
|
||||
return ControlPaint.Light(basecolor, 50);
|
||||
if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(218, 223, 218);
|
||||
return ControlPaint.Light(basecolor, 70);
|
||||
}
|
||||
|
||||
public static Color GetDarkFromColor(Color basecolor)
|
||||
{
|
||||
if (basecolor == Color.FromArgb(112, 112, 112)) return Color.FromArgb(72, 72, 72);
|
||||
return ControlPaint.Dark(basecolor, 50);
|
||||
if (basecolor == Color.FromArgb(169, 200, 169)) return Color.FromArgb(95, 153, 95);
|
||||
return ControlPaint.Dark(basecolor, 70);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ public WinClassic()
|
|||
|
||||
public Font fnt;
|
||||
public ResizeOverlay resizer = new ResizeOverlay();
|
||||
public UserControl progContent;
|
||||
|
||||
public bool resizable = true;
|
||||
public bool closeDisabled = false;
|
||||
|
|
|
@ -127,6 +127,11 @@ public InsideComputerTheme()
|
|||
|
||||
asteriskSound = Properties.Resources.Win95PlusInsideComputerAsterisk;
|
||||
|
||||
threeDObjectsColor = Color.FromArgb(169, 200, 169);
|
||||
threeDObjectsTextColor = Color.Black;
|
||||
|
||||
buttonFont = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold);
|
||||
|
||||
activeTitleBarColor = Color.FromArgb(224, 0, 0);
|
||||
activeTitleTextColor = Color.White;
|
||||
inactiveTitleBarColor = Color.FromArgb(96, 168, 128);
|
||||
|
|
|
@ -60,6 +60,7 @@ public WinClassic Init(UserControl content, string title, Image icon, bool MaxBu
|
|||
content.Parent = app.programContent;
|
||||
content.BringToFront();
|
||||
content.Dock = DockStyle.Fill;
|
||||
app.progContent = content;
|
||||
|
||||
// Check if icon is null
|
||||
if (icon == null)
|
||||
|
|
|
@ -96,7 +96,17 @@ private void applyButton_Click(object sender, EventArgs e)
|
|||
((WinClassic)f).Title.ForeColor = SaveSystem.currentTheme.inactiveTitleTextColor;
|
||||
}
|
||||
f.Invalidate();
|
||||
foreach (Control c in f.Controls) c.Invalidate();
|
||||
((WinClassic)f).programContent.Invalidate();
|
||||
((WinClassic)f).top.Invalidate();
|
||||
((WinClassic)f).toprightcorner.Invalidate();
|
||||
((WinClassic)f).right.Invalidate();
|
||||
((WinClassic)f).bottomrightcorner.Invalidate();
|
||||
((WinClassic)f).bottom.Invalidate();
|
||||
((WinClassic)f).bottomleftcorner.Invalidate();
|
||||
((WinClassic)f).left.Invalidate();
|
||||
((WinClassic)f).topleftcorner.Invalidate();
|
||||
foreach (Control c in ((WinClassic)f).progContent.Controls) c.Invalidate();
|
||||
((WinClassic)f).progContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +149,17 @@ private void okButton_Click(object sender, EventArgs e)
|
|||
((WinClassic)f).Title.ForeColor = SaveSystem.currentTheme.inactiveTitleTextColor;
|
||||
}
|
||||
f.Invalidate();
|
||||
foreach (Control c in f.Controls) c.Invalidate();
|
||||
((WinClassic)f).programContent.Invalidate();
|
||||
((WinClassic)f).top.Invalidate();
|
||||
((WinClassic)f).toprightcorner.Invalidate();
|
||||
((WinClassic)f).right.Invalidate();
|
||||
((WinClassic)f).bottomrightcorner.Invalidate();
|
||||
((WinClassic)f).bottom.Invalidate();
|
||||
((WinClassic)f).bottomleftcorner.Invalidate();
|
||||
((WinClassic)f).left.Invalidate();
|
||||
((WinClassic)f).topleftcorner.Invalidate();
|
||||
foreach (Control c in ((WinClassic)f).progContent.Controls) c.Invalidate();
|
||||
((WinClassic)f).progContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
|
||||
}
|
||||
}
|
||||
ParentForm.Close();
|
||||
|
|
Loading…
Reference in a new issue