diff options
| author | Michael <[email protected]> | 2017-06-27 20:07:09 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-06-27 20:07:09 -0400 |
| commit | cd2190f6caa16e8d909aa1d662996d690772a67f (patch) | |
| tree | 81bf2c6168298d937ae3a56ba26a99577e49eee1 /ShiftOS.WinForms | |
| parent | 58246abf512710ad0a9577c7ef46a87f79bfb7b7 (diff) | |
| download | shiftos_thereturn-cd2190f6caa16e8d909aa1d662996d690772a67f.tar.gz shiftos_thereturn-cd2190f6caa16e8d909aa1d662996d690772a67f.tar.bz2 shiftos_thereturn-cd2190f6caa16e8d909aa1d662996d690772a67f.zip | |
Multistate title button skinning.
Diffstat (limited to 'ShiftOS.WinForms')
| -rw-r--r-- | ShiftOS.WinForms/WindowBorder.Designer.cs | 12 | ||||
| -rw-r--r-- | ShiftOS.WinForms/WindowBorder.cs | 108 |
2 files changed, 120 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/WindowBorder.Designer.cs b/ShiftOS.WinForms/WindowBorder.Designer.cs index e862c35..490e1fb 100644 --- a/ShiftOS.WinForms/WindowBorder.Designer.cs +++ b/ShiftOS.WinForms/WindowBorder.Designer.cs @@ -107,6 +107,10 @@ namespace ShiftOS.WinForms this.pnlminimize.Size = new System.Drawing.Size(24, 24); this.pnlminimize.TabIndex = 3; this.pnlminimize.Click += new System.EventHandler(this.pnlminimize_Click); + this.pnlminimize.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlminimize_MouseDown); + this.pnlminimize.MouseEnter += new System.EventHandler(this.pnlminimize_MouseEnter); + this.pnlminimize.MouseLeave += new System.EventHandler(this.pnlminimize_MouseLeave); + this.pnlminimize.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlminimize_MouseUp); // // pnlmaximize // @@ -117,6 +121,10 @@ namespace ShiftOS.WinForms this.pnlmaximize.Size = new System.Drawing.Size(24, 24); this.pnlmaximize.TabIndex = 2; this.pnlmaximize.Click += new System.EventHandler(this.pnlmaximize_Click); + this.pnlmaximize.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlmaximize_MouseDown); + this.pnlmaximize.MouseEnter += new System.EventHandler(this.pnlmaximize_MouseEnter); + this.pnlmaximize.MouseLeave += new System.EventHandler(this.pnlmaximize_MouseLeave); + this.pnlmaximize.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlmaximize_MouseUp); // // pnlclose // @@ -127,6 +135,10 @@ namespace ShiftOS.WinForms this.pnlclose.Size = new System.Drawing.Size(24, 24); this.pnlclose.TabIndex = 1; this.pnlclose.Click += new System.EventHandler(this.pnlclose_Click); + this.pnlclose.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlclose_MouseDown); + this.pnlclose.MouseEnter += new System.EventHandler(this.pnlclose_MouseEnter); + this.pnlclose.MouseLeave += new System.EventHandler(this.pnlclose_MouseLeave); + this.pnlclose.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlclose_MouseUp); // // pnltitleleft // diff --git a/ShiftOS.WinForms/WindowBorder.cs b/ShiftOS.WinForms/WindowBorder.cs index 0ee1289..e056350 100644 --- a/ShiftOS.WinForms/WindowBorder.cs +++ b/ShiftOS.WinForms/WindowBorder.cs @@ -686,5 +686,113 @@ namespace ShiftOS.WinForms } } + + private void pnlclose_MouseDown(object sender, MouseEventArgs e) + { + pnlclose.BackColor = LoadedSkin.CloseButtonDownColor; + if(LoadedSkin.CloseButtonDownImage != null) + { + pnlclose.BackgroundImage = GetImage("closebuttondown"); + pnlclose.BackgroundImageLayout = GetImageLayout("closebuttondown"); + } + } + + private void pnlclose_MouseEnter(object sender, EventArgs e) + { + pnlclose.BackColor = LoadedSkin.CloseButtonOverColor; + if (LoadedSkin.CloseButtonOverImage != null) + { + pnlclose.BackgroundImage = GetImage("closebuttonover"); + pnlclose.BackgroundImageLayout = GetImageLayout("closebuttonover"); + } + + } + + private void pnlclose_MouseLeave(object sender, EventArgs e) + { + pnlclose.BackColor = LoadedSkin.CloseButtonColor; + pnlclose.BackgroundImage = GetImage("closebutton"); + pnlclose.BackgroundImageLayout = GetImageLayout("closebutton"); + } + + private void pnlclose_MouseUp(object sender, MouseEventArgs e) + { + pnlclose.BackColor = LoadedSkin.CloseButtonColor; + pnlclose.BackgroundImage = GetImage("closebutton"); + pnlclose.BackgroundImageLayout = GetImageLayout("closebutton"); + + } + + private void pnlmaximize_MouseDown(object sender, MouseEventArgs e) + { + + pnlmaximize.BackColor = LoadedSkin.MaximizeButtonDownColor; + if (LoadedSkin.MaximizeButtonDownImage != null) + { + pnlmaximize.BackgroundImage = GetImage("maximizebuttondown"); + pnlmaximize.BackgroundImageLayout = GetImageLayout("maximizebuttondown"); + } + } + + private void pnlmaximize_MouseEnter(object sender, EventArgs e) + { + pnlmaximize.BackColor = LoadedSkin.MaximizeButtonOverColor; + if (LoadedSkin.MaximizeButtonOverImage != null) + { + pnlmaximize.BackgroundImage = GetImage("maximizebuttonover"); + pnlmaximize.BackgroundImageLayout = GetImageLayout("maximizebuttonover"); + } + + } + + private void pnlmaximize_MouseLeave(object sender, EventArgs e) + { + pnlmaximize.BackColor = LoadedSkin.MaximizeButtonColor; + pnlmaximize.BackgroundImage = GetImage("maximizebutton"); + pnlmaximize.BackgroundImageLayout = GetImageLayout("maximizebutton"); + } + + private void pnlmaximize_MouseUp(object sender, MouseEventArgs e) + { + pnlmaximize.BackColor = LoadedSkin.MaximizeButtonColor; + pnlmaximize.BackgroundImage = GetImage("maximizebutton"); + pnlmaximize.BackgroundImageLayout = GetImageLayout("maximizebutton"); + } + + private void pnlminimize_MouseDown(object sender, MouseEventArgs e) + { + + pnlminimize.BackColor = LoadedSkin.MinimizeButtonDownColor; + if (LoadedSkin.MinimizeButtonDownImage != null) + { + pnlminimize.BackgroundImage = GetImage("minimizebuttondown"); + pnlminimize.BackgroundImageLayout = GetImageLayout("minimizebuttondown"); + } + } + + private void pnlminimize_MouseEnter(object sender, EventArgs e) + { + pnlminimize.BackColor = LoadedSkin.MinimizeButtonOverColor; + if (LoadedSkin.MinimizeButtonOverImage != null) + { + pnlminimize.BackgroundImage = GetImage("minimizebuttonover"); + pnlminimize.BackgroundImageLayout = GetImageLayout("minimizebuttonover"); + } + + } + + private void pnlminimize_MouseLeave(object sender, EventArgs e) + { + pnlminimize.BackColor = LoadedSkin.MinimizeButtonColor; + pnlminimize.BackgroundImage = GetImage("minimizebutton"); + pnlminimize.BackgroundImageLayout = GetImageLayout("minimizebutton"); + } + + private void pnlminimize_MouseUp(object sender, MouseEventArgs e) + { + pnlminimize.BackColor = LoadedSkin.MinimizeButtonColor; + pnlminimize.BackgroundImage = GetImage("minimizebutton"); + pnlminimize.BackgroundImageLayout = GetImageLayout("minimizebutton"); + } } } |
