From 6a100bc8794d0e7313868a4b7082d9475117617c Mon Sep 17 00:00:00 2001 From: lempamo Date: Wed, 15 Nov 2017 19:23:40 -0500 Subject: [PATCH] added in gradient top bar to winclassic --- Histacom2.Engine/Template/WinClassic.Designer.cs | 1 + Histacom2.Engine/Template/WinClassic.cs | 16 ++++++++++++++++ Histacom2.Engine/Theme.cs | 2 ++ Histacom2/GlobalPrograms/WinClassicNotepad.cs | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Histacom2.Engine/Template/WinClassic.Designer.cs b/Histacom2.Engine/Template/WinClassic.Designer.cs index 8b9497f..3c03f87 100644 --- a/Histacom2.Engine/Template/WinClassic.Designer.cs +++ b/Histacom2.Engine/Template/WinClassic.Designer.cs @@ -105,6 +105,7 @@ private void InitializeComponent() this.programtopbar.Size = new System.Drawing.Size(292, 18); this.programtopbar.TabIndex = 0; this.programtopbar.Tag = ""; + this.programtopbar.Paint += new System.Windows.Forms.PaintEventHandler(this.programtopbar_Paint); this.programtopbar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Programtopbar_drag); // // programIcon diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs index c911af3..ae1d361 100644 --- a/Histacom2.Engine/Template/WinClassic.cs +++ b/Histacom2.Engine/Template/WinClassic.cs @@ -1,5 +1,6 @@ using System; using System.Drawing; +using System.Drawing.Drawing2D; using System.Runtime.InteropServices; using System.Windows.Forms; @@ -335,6 +336,21 @@ private void minimizebutton_Click(object sender, EventArgs e) Hide(); } + private void programtopbar_Paint(object sender, PaintEventArgs e) + { + var gfx = e.Graphics; + if (isActive) + { + if (SaveSystem.currentTheme.activeTitleBarColor2 == null) return; + gfx.FillRectangle(new LinearGradientBrush(programtopbar.ClientRectangle, SaveSystem.currentTheme.activeTitleBarColor, SaveSystem.currentTheme.activeTitleBarColor2, 0.0), programtopbar.ClientRectangle); + } + else + { + if (SaveSystem.currentTheme.inactiveTitleBarColor2 == null) return; + gfx.FillRectangle(new LinearGradientBrush(programtopbar.ClientRectangle, SaveSystem.currentTheme.inactiveTitleBarColor, SaveSystem.currentTheme.inactiveTitleBarColor2, 0.0), programtopbar.ClientRectangle); + } + } + public Size prevSize; public Point prevPoint; private void maximizebutton_Click(object sender, EventArgs e) diff --git a/Histacom2.Engine/Theme.cs b/Histacom2.Engine/Theme.cs index 6a25602..d4b56c1 100644 --- a/Histacom2.Engine/Theme.cs +++ b/Histacom2.Engine/Theme.cs @@ -27,8 +27,10 @@ public class Theme public Color windowColor { get; set; } public Color activeTitleBarColor { get; set; } + public Color activeTitleBarColor2 { get; set; } public Color activeTitleTextColor { get; set; } public Color inactiveTitleBarColor { get; set; } + public Color inactiveTitleBarColor2 { get; set; } public Color inactiveTitleTextColor { get; set; } public Color selectedBackColor { get; set; } diff --git a/Histacom2/GlobalPrograms/WinClassicNotepad.cs b/Histacom2/GlobalPrograms/WinClassicNotepad.cs index 4334a5e..866d8d3 100644 --- a/Histacom2/GlobalPrograms/WinClassicNotepad.cs +++ b/Histacom2/GlobalPrograms/WinClassicNotepad.cs @@ -38,7 +38,7 @@ private void aboutNotepadToolStripMenuItem_Click(object sender, EventArgs e) { WindowManager wm = new WindowManager(); if (SaveSystem.CurrentSave.CurrentOS == "95") wm.StartAboutBox95("Notepad", "Microsoft Notepad", Properties.Resources.WinClassicNotepad); - else wm.StartAboutBox98("Notepad", "Microsoft Notepad", Properties.Resources.WinClassicNotepad); + else wm.StartAboutBox98("Notepad", "Microsoft (R) Notepad", Properties.Resources.WinClassicNotepad); } private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e)