aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-06-20 18:53:28 -0400
committerMichael <[email protected]>2017-06-20 18:53:28 -0400
commit153057c7be952a94ab63a790662a10eee7b68e3d (patch)
tree901ea65cee8266c5ba3649ddf207dab7bc9278a5
parent472b658c22ba4b19bb49420d5b24d785c6e15655 (diff)
downloadshiftos_thereturn-153057c7be952a94ab63a790662a10eee7b68e3d.tar.gz
shiftos_thereturn-153057c7be952a94ab63a790662a10eee7b68e3d.tar.bz2
shiftos_thereturn-153057c7be952a94ab63a790662a10eee7b68e3d.zip
Opt-in multistate borders
-rw-r--r--ShiftOS.WinForms/Applications/Artpad.Designer.cs1
-rw-r--r--ShiftOS.WinForms/WindowBorder.cs132
-rw-r--r--ShiftOS_TheReturn/Skinning.cs7
3 files changed, 80 insertions, 60 deletions
diff --git a/ShiftOS.WinForms/Applications/Artpad.Designer.cs b/ShiftOS.WinForms/Applications/Artpad.Designer.cs
index c5a313d..f30839a 100644
--- a/ShiftOS.WinForms/Applications/Artpad.Designer.cs
+++ b/ShiftOS.WinForms/Applications/Artpad.Designer.cs
@@ -2058,7 +2058,6 @@ namespace ShiftOS.WinForms.Applications
this.Label4.TabIndex = 11;
this.Label4.Text = "Colors";
this.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- this.Label4.Click += new System.EventHandler(this.Label4_Click);
//
// line6
//
diff --git a/ShiftOS.WinForms/WindowBorder.cs b/ShiftOS.WinForms/WindowBorder.cs
index 7aefd42..0ee1289 100644
--- a/ShiftOS.WinForms/WindowBorder.cs
+++ b/ShiftOS.WinForms/WindowBorder.cs
@@ -262,6 +262,74 @@ namespace ShiftOS.WinForms
}
}
+ public void SetDefaultBorders()
+ {
+ pnltitle.BackColor = LoadedSkin.TitleBackgroundColor;
+ pnltitle.BackgroundImage = GetImage("titlebar");
+ pnltitleleft.BackColor = LoadedSkin.TitleLeftCornerBackground;
+ pnltitleright.BackColor = LoadedSkin.TitleRightCornerBackground;
+ pnltitleleft.BackgroundImage = GetImage("titleleft");
+ pnltitleleft.BackgroundImageLayout = GetImageLayout("titleleft");
+ pnltitleright.BackgroundImage = GetImage("titleright");
+ pnltitleright.BackgroundImageLayout = GetImageLayout("titleright");
+ pnltitle.BackgroundImageLayout = GetImageLayout("titlebar"); //RETARD ALERT. WHY WASN'T THIS THERE WHEN IMAGELAYOUTS WERE FIRST IMPLEMENTED?
+
+ pnlleft.BackColor = LoadedSkin.BorderLeftBackground;
+ pnlleft.BackgroundImage = GetImage("leftborder");
+ pnlleft.BackgroundImageLayout = GetImageLayout("leftborder");
+
+ pnlright.BackColor = LoadedSkin.BorderRightBackground;
+ pnlright.BackgroundImage = GetImage("rightborder");
+ pnlright.BackgroundImageLayout = GetImageLayout("rightborder");
+
+ pnlbottom.BackColor = LoadedSkin.BorderBottomBackground;
+ pnlbottom.BackgroundImage = GetImage("bottomborder");
+ pnlbottom.BackgroundImageLayout = GetImageLayout("bottomborder");
+
+ pnlbottomr.BackColor = LoadedSkin.BorderBottomRightBackground;
+ pnlbottomr.BackgroundImage = GetImage("bottomrborder");
+ pnlbottomr.BackgroundImageLayout = GetImageLayout("bottomrborder");
+
+ pnlbottoml.BackColor = LoadedSkin.BorderBottomLeftBackground;
+ pnlbottoml.BackgroundImage = GetImage("bottomlborder");
+ pnlbottoml.BackgroundImageLayout = GetImageLayout("bottomlborder");
+
+ }
+
+ public void SetInactiveBorders()
+ {
+ pnltitle.BackColor = LoadedSkin.TitleInactiveBackgroundColor;
+ pnltitle.BackgroundImage = GetImage("titlebarinactive");
+ pnltitleleft.BackColor = LoadedSkin.TitleInactiveLeftCornerBackground;
+ pnltitleright.BackColor = LoadedSkin.TitleInactiveRightCornerBackground;
+ pnltitleleft.BackgroundImage = GetImage("titleleftinactive");
+ pnltitleleft.BackgroundImageLayout = GetImageLayout("titleleftinactive");
+ pnltitleright.BackgroundImage = GetImage("titlerightinactive");
+ pnltitleright.BackgroundImageLayout = GetImageLayout("titlerightinactive");
+ pnltitle.BackgroundImageLayout = GetImageLayout("titlebarinactive"); //RETARD ALERT. WHY WASN'T THIS THERE WHEN IMAGELAYOUTS WERE FIRST IMPLEMENTED?
+
+ pnlleft.BackColor = LoadedSkin.BorderInactiveLeftBackground;
+ pnlleft.BackgroundImage = GetImage("leftborderinactive");
+ pnlleft.BackgroundImageLayout = GetImageLayout("leftborderinactive");
+
+ pnlright.BackColor = LoadedSkin.BorderInactiveRightBackground;
+ pnlright.BackgroundImage = GetImage("rightborderinactive");
+ pnlright.BackgroundImageLayout = GetImageLayout("rightborderinactive");
+
+ pnlbottom.BackColor = LoadedSkin.BorderInactiveBottomBackground;
+ pnlbottom.BackgroundImage = GetImage("bottomborderinactive");
+ pnlbottom.BackgroundImageLayout = GetImageLayout("bottomborderinactive");
+
+ pnlbottomr.BackColor = LoadedSkin.BorderInactiveBottomRightBackground;
+ pnlbottomr.BackgroundImage = GetImage("bottomrborderinactive");
+ pnlbottomr.BackgroundImageLayout = GetImageLayout("bottomrborderinactive");
+
+ pnlbottoml.BackColor = LoadedSkin.BorderInactiveBottomLeftBackground;
+ pnlbottoml.BackgroundImage = GetImage("bottomlborderinactive");
+ pnlbottoml.BackgroundImageLayout = GetImageLayout("bottomlborderinactive");
+
+ }
+
/// <summary>
/// Setups the skin.
/// </summary>
@@ -271,68 +339,14 @@ namespace ShiftOS.WinForms
//Border colors and images...
if (IsFocused)
{
- pnltitle.BackColor = LoadedSkin.TitleBackgroundColor;
- pnltitle.BackgroundImage = GetImage("titlebar");
- pnltitleleft.BackColor = LoadedSkin.TitleLeftCornerBackground;
- pnltitleright.BackColor = LoadedSkin.TitleRightCornerBackground;
- pnltitleleft.BackgroundImage = GetImage("titleleft");
- pnltitleleft.BackgroundImageLayout = GetImageLayout("titleleft");
- pnltitleright.BackgroundImage = GetImage("titleright");
- pnltitleright.BackgroundImageLayout = GetImageLayout("titleright");
- pnltitle.BackgroundImageLayout = GetImageLayout("titlebar"); //RETARD ALERT. WHY WASN'T THIS THERE WHEN IMAGELAYOUTS WERE FIRST IMPLEMENTED?
-
- pnlleft.BackColor = LoadedSkin.BorderLeftBackground;
- pnlleft.BackgroundImage = GetImage("leftborder");
- pnlleft.BackgroundImageLayout = GetImageLayout("leftborder");
-
- pnlright.BackColor = LoadedSkin.BorderRightBackground;
- pnlright.BackgroundImage = GetImage("rightborder");
- pnlright.BackgroundImageLayout = GetImageLayout("rightborder");
-
- pnlbottom.BackColor = LoadedSkin.BorderBottomBackground;
- pnlbottom.BackgroundImage = GetImage("bottomborder");
- pnlbottom.BackgroundImageLayout = GetImageLayout("bottomborder");
-
- pnlbottomr.BackColor = LoadedSkin.BorderBottomRightBackground;
- pnlbottomr.BackgroundImage = GetImage("bottomrborder");
- pnlbottomr.BackgroundImageLayout = GetImageLayout("bottomrborder");
-
- pnlbottoml.BackColor = LoadedSkin.BorderBottomLeftBackground;
- pnlbottoml.BackgroundImage = GetImage("bottomlborder");
- pnlbottoml.BackgroundImageLayout = GetImageLayout("bottomlborder");
+ SetDefaultBorders();
}
else
{
- pnltitle.BackColor = LoadedSkin.TitleInactiveBackgroundColor;
- pnltitle.BackgroundImage = GetImage("titlebarinactive");
- pnltitleleft.BackColor = LoadedSkin.TitleInactiveLeftCornerBackground;
- pnltitleright.BackColor = LoadedSkin.TitleInactiveRightCornerBackground;
- pnltitleleft.BackgroundImage = GetImage("titleleftinactive");
- pnltitleleft.BackgroundImageLayout = GetImageLayout("titleleftinactive");
- pnltitleright.BackgroundImage = GetImage("titlerightinactive");
- pnltitleright.BackgroundImageLayout = GetImageLayout("titlerightinactive");
- pnltitle.BackgroundImageLayout = GetImageLayout("titlebarinactive"); //RETARD ALERT. WHY WASN'T THIS THERE WHEN IMAGELAYOUTS WERE FIRST IMPLEMENTED?
-
- pnlleft.BackColor = LoadedSkin.BorderInactiveLeftBackground;
- pnlleft.BackgroundImage = GetImage("leftborderinactive");
- pnlleft.BackgroundImageLayout = GetImageLayout("leftborderinactive");
-
- pnlright.BackColor = LoadedSkin.BorderInactiveRightBackground;
- pnlright.BackgroundImage = GetImage("rightborderinactive");
- pnlright.BackgroundImageLayout = GetImageLayout("rightborderinactive");
-
- pnlbottom.BackColor = LoadedSkin.BorderInactiveBottomBackground;
- pnlbottom.BackgroundImage = GetImage("bottomborderinactive");
- pnlbottom.BackgroundImageLayout = GetImageLayout("bottomborderinactive");
-
- pnlbottomr.BackColor = LoadedSkin.BorderInactiveBottomRightBackground;
- pnlbottomr.BackgroundImage = GetImage("bottomrborderinactive");
- pnlbottomr.BackgroundImageLayout = GetImageLayout("bottomrborderinactive");
-
- pnlbottoml.BackColor = LoadedSkin.BorderInactiveBottomLeftBackground;
- pnlbottoml.BackgroundImage = GetImage("bottomlborderinactive");
- pnlbottoml.BackgroundImageLayout = GetImageLayout("bottomlborderinactive");
-
+ if (LoadedSkin.RenderInactiveBorders)
+ SetInactiveBorders();
+ else
+ SetDefaultBorders();
}
diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs
index e0a1a2b..656da30 100644
--- a/ShiftOS_TheReturn/Skinning.cs
+++ b/ShiftOS_TheReturn/Skinning.cs
@@ -634,6 +634,13 @@ namespace ShiftOS.Engine
[ShifterDescription("The background color for the bottom border when the window is inactive.")]
public Color BorderInactiveBottomBackground = DefaultBackground;
+ [ShifterMeta("Windows")]
+ [ShifterCategory("Window border")]
+ [ShifterName("Use Inactive Border Assets?")]
+ [RequiresUpgrade("shift_window_borders;shift_states")]
+ [ShifterDescription("Do you want to use separate colors and images for inactive Window Borders?")]
+ public bool RenderInactiveBorders = false;
+
[ShifterMeta("Desktop")]
[ShifterCategory("Panel buttons")]