aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-06-20 18:02:13 -0400
committerMichael <[email protected]>2017-06-20 18:02:13 -0400
commit41504bdc15d6c7512b5fe1a111529d8a39587f61 (patch)
tree1e0cd2ba9034a347250ac63077374c284099707b
parentdf14761a81a938423d16494101b871779825c98e (diff)
downloadshiftos_thereturn-41504bdc15d6c7512b5fe1a111529d8a39587f61.tar.gz
shiftos_thereturn-41504bdc15d6c7512b5fe1a111529d8a39587f61.tar.bz2
shiftos_thereturn-41504bdc15d6c7512b5fe1a111529d8a39587f61.zip
inactive border colors
-rw-r--r--ShiftOS.WinForms/WindowBorder.cs107
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs1
-rw-r--r--ShiftOS_TheReturn/Skinning.cs68
3 files changed, 151 insertions, 25 deletions
diff --git a/ShiftOS.WinForms/WindowBorder.cs b/ShiftOS.WinForms/WindowBorder.cs
index 40dc629..7aefd42 100644
--- a/ShiftOS.WinForms/WindowBorder.cs
+++ b/ShiftOS.WinForms/WindowBorder.cs
@@ -48,6 +48,8 @@ namespace ShiftOS.WinForms
/// </summary>
public partial class WindowBorder : Form, IWindowBorder
{
+ private bool IsFocused { get; set; }
+
/// <summary>
/// Raises the closing event.
/// </summary>
@@ -109,6 +111,17 @@ namespace ShiftOS.WinForms
public WindowBorder(UserControl win)
{
InitializeComponent();
+ IsFocused = true;
+ this.Activated += (o, a) =>
+ {
+ IsFocused = true;
+ SetupSkin();
+ };
+ this.Deactivate += (o, a) =>
+ {
+ IsFocused = false;
+ SetupSkin();
+ };
this._parentWindow = win;
Shiftorium.Installed += () =>
{
@@ -255,49 +268,93 @@ namespace ShiftOS.WinForms
/// <returns>The skin.</returns>
public void SetupSkin()
{
+ //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");
+ }
+ 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");
+
+ }
+
+
this.DoubleBuffered = true;
this.TransparencyKey = LoadedSkin.SystemKey;
pnlcontents.BackColor = this.TransparencyKey;
pnltitle.Height = LoadedSkin.TitlebarHeight;
- pnltitle.BackColor = LoadedSkin.TitleBackgroundColor;
- pnltitle.BackgroundImage = GetImage("titlebar");
pnltitleleft.Visible = LoadedSkin.ShowTitleCorners;
pnltitleright.Visible = LoadedSkin.ShowTitleCorners;
- pnltitleleft.BackColor = LoadedSkin.TitleLeftCornerBackground;
- pnltitleright.BackColor = LoadedSkin.TitleRightCornerBackground;
pnltitleleft.Width = LoadedSkin.TitleLeftCornerWidth;
pnltitleright.Width = LoadedSkin.TitleRightCornerWidth;
- 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?
-
+
lbtitletext.BackColor = (pnltitle.BackgroundImage != null) ? Color.Transparent : LoadedSkin.TitleBackgroundColor;
lbtitletext.ForeColor = LoadedSkin.TitleTextColor;
lbtitletext.Font = LoadedSkin.TitleFont;
- pnlleft.BackColor = LoadedSkin.BorderLeftBackground;
- pnlleft.BackgroundImage = GetImage("leftborder");
- pnlleft.BackgroundImageLayout = GetImageLayout("leftborder");
pnlleft.Width = LoadedSkin.LeftBorderWidth;
- pnlright.BackColor = LoadedSkin.BorderRightBackground;
- pnlright.BackgroundImage = GetImage("rightborder");
- pnlright.BackgroundImageLayout = GetImageLayout("rightborder");
pnlright.Width = LoadedSkin.RightBorderWidth;
- pnlbottom.BackColor = LoadedSkin.BorderBottomBackground;
- pnlbottom.BackgroundImage = GetImage("bottomborder");
- pnlbottom.BackgroundImageLayout = GetImageLayout("bottomborder");
pnlbottom.Height = LoadedSkin.BottomBorderWidth;
- pnlbottomr.BackColor = LoadedSkin.BorderBottomRightBackground;
- pnlbottomr.BackgroundImage = GetImage("bottomrborder");
- pnlbottomr.BackgroundImageLayout = GetImageLayout("bottomrborder");
pnlbottomr.Width = pnlright.Width;
- pnlbottoml.BackColor = LoadedSkin.BorderBottomLeftBackground;
- pnlbottoml.BackgroundImage = GetImage("bottomlborder");
- pnlbottoml.BackgroundImageLayout = GetImageLayout("bottomlborder");
pnlbottoml.Width = pnlleft.Width;
lbtitletext.ForeColor = LoadedSkin.TitleTextColor;
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index b247969..7508262 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -910,6 +910,7 @@ namespace ShiftOS.WinForms
public void ShowWindow(IWindowBorder border)
{
var brdr = border as Form;
+
focused = border;
brdr.GotFocus += (o, a) =>
{
diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs
index e00a2ef..e0a1a2b 100644
--- a/ShiftOS_TheReturn/Skinning.cs
+++ b/ShiftOS_TheReturn/Skinning.cs
@@ -575,6 +575,15 @@ namespace ShiftOS.Engine
public Color TitleBackgroundColor = TitleBG;
[ShifterMeta("Windows")]
+ [ShifterCategory("Titlebar")]
+ [ShifterName("Title Inactive Background Color")]
+ [RequiresUpgrade("shift_titlebar;shift_states")]
+ [ShifterDescription("The color of the titlebar's background when the window isn't active.")]
+ public Color TitleInactiveBackgroundColor = Skin.DefaultBackground;
+
+
+
+ [ShifterMeta("Windows")]
[ShifterCategory("Window border")]
[ShifterName("Left Border Background")]
[RequiresUpgrade("shift_window_borders")]
@@ -583,11 +592,27 @@ namespace ShiftOS.Engine
[ShifterMeta("Windows")]
[ShifterCategory("Window border")]
+ [ShifterName("Left Border Inactive Background")]
+ [RequiresUpgrade("shift_window_borders;shift_states")]
+ [ShifterDescription("The background color for the left border when the window is inactive.")]
+ public Color BorderInactiveLeftBackground = DefaultBackground;
+
+
+ [ShifterMeta("Windows")]
+ [ShifterCategory("Window border")]
[ShifterName("Right Border Background")]
[RequiresUpgrade("shift_window_borders")]
[ShifterDescription("The background color for the right border.")]
public Color BorderRightBackground = TitleBG;
+ [ShifterMeta("Windows")]
+ [ShifterCategory("Window border")]
+ [ShifterName("Right Border Inactive Background")]
+ [RequiresUpgrade("shift_window_borders;shift_states")]
+ [ShifterDescription("The background color for the right border when the window is inactive.")]
+ public Color BorderInactiveRightBackground = DefaultBackground;
+
+
[ShifterMeta("Desktop")]
[ShifterCategory("Panel buttons")]
[RequiresUpgrade("shift_panel_buttons")]
@@ -602,6 +627,14 @@ namespace ShiftOS.Engine
[ShifterDescription("The background color for the bottom border.")]
public Color BorderBottomBackground = TitleBG;
+ [ShifterMeta("Windows")]
+ [ShifterCategory("Window border")]
+ [ShifterName("Bottom Border Inactive Background")]
+ [RequiresUpgrade("shift_window_borders;shift_states")]
+ [ShifterDescription("The background color for the bottom border when the window is inactive.")]
+ public Color BorderInactiveBottomBackground = DefaultBackground;
+
+
[ShifterMeta("Desktop")]
[ShifterCategory("Panel buttons")]
[ShifterName("Panel button holder from left")]
@@ -611,11 +644,20 @@ namespace ShiftOS.Engine
[ShifterMeta("Windows")]
[ShifterCategory("Window border")]
+ [ShifterName("Bottom Left Border Inactive Background")]
+ [RequiresUpgrade("shift_window_borders;shift_states")]
+ [ShifterDescription("The background color for the bottom left border when the window is inactive.")]
+ public Color BorderInactiveBottomLeftBackground = DefaultBackground;
+
+
+ [ShifterMeta("Windows")]
+ [ShifterCategory("Window border")]
[ShifterName("Bottom Left Border Background")]
[RequiresUpgrade("shift_window_borders")]
[ShifterDescription("The background color for the bottom left border.")]
public Color BorderBottomLeftBackground = TitleBG;
+
[ShifterMeta("Windows")]
[ShifterCategory("Window border")]
[ShifterName("Bottom Right Border Background")]
@@ -624,6 +666,14 @@ namespace ShiftOS.Engine
public Color BorderBottomRightBackground = TitleBG;
[ShifterMeta("Windows")]
+ [ShifterCategory("Window border")]
+ [ShifterName("Bottom Right Border Inactive Background")]
+ [RequiresUpgrade("shift_window_borders;shift_states")]
+ [ShifterDescription("The background color for the bottom right border when the window is inactive.")]
+ public Color BorderInactiveBottomRightBackground = DefaultBackground;
+
+
+ [ShifterMeta("Windows")]
[ShifterCategory("Title Buttons")]
[ShifterName("Close Button Color")]
[RequiresUpgrade("shift_title_buttons")]
@@ -1150,6 +1200,15 @@ namespace ShiftOS.Engine
[ShifterMeta("Windows")]
[ShifterCategory("Titlebar")]
+ [RequiresUpgrade("shift_titlebar;shift_states")]
+ [ShifterFlag("ShowTitleCorners", true)]
+ [ShifterName("Title left inactive background color")]
+ [ShifterDescription("What color should be used for the left title corner when the window is inactive?")]
+ public Color TitleInactiveLeftCornerBackground = DefaultBackground;
+
+
+ [ShifterMeta("Windows")]
+ [ShifterCategory("Titlebar")]
[RequiresUpgrade("shift_titlebar")]
[ShifterFlag("ShowTitleCorners", true)]
[ShifterName("Title right background color")]
@@ -1158,6 +1217,15 @@ namespace ShiftOS.Engine
[ShifterMeta("Windows")]
[ShifterCategory("Titlebar")]
+ [RequiresUpgrade("shift_titlebar;shift_states")]
+ [ShifterFlag("ShowTitleCorners", true)]
+ [ShifterName("Title right inactive background color")]
+ [ShifterDescription("What color should be used for the right title corner when the window is inactive?")]
+ public Color TitleInactiveRightCornerBackground = DefaultBackground;
+
+
+ [ShifterMeta("Windows")]
+ [ShifterCategory("Titlebar")]
[RequiresUpgrade("shift_titlebar")]
[ShifterFlag("ShowTitleCorners", true)]
[ShifterName("Title left corner width")]