diff --git a/source/WindowsFormsApplication1/SkinEngine/skins.cs b/source/WindowsFormsApplication1/SkinEngine/skins.cs index 72f5021..f23a7b5 100644 --- a/source/WindowsFormsApplication1/SkinEngine/skins.cs +++ b/source/WindowsFormsApplication1/SkinEngine/skins.cs @@ -10,8 +10,18 @@ namespace Skinning { - [Obsolete("ShiftOS is moving to the new ShiftUI framework which has a built-in skinning engine. This Skin class is mostly un-needed now.")] - public class Skin { + public class Skin : ShiftUI.ShiftOS.Skin + { + //ShiftUI inherits: Anything marked with 'public new' is inherited + //from ShiftUI.ShiftOS.Skin, and is marked this way to provide a + //default value that JSON.NET can deserialize but also have + //ShiftUI see it. + + + + public new Color ButtonBackColor_Pressed = Color.Black; + + public new Color ProgressBar_BackgroundColor = Color.Black; //Widget Positions public string ALPosition = "Top"; public string PanelButtonPosition = "Top"; @@ -19,65 +29,65 @@ public class Skin { //WINDOW SETTINGS/IMAGES //images - public int titlebarlayout = 3; - public int borderleftlayout = 3; - public int borderrightlayout = 3; - public int borderbottomlayout = 3; - public int closebtnlayout = 3; - public int rollbtnlayout = 3; - public int minbtnlayout = 3; - public int rightcornerlayout = 3; - public int leftcornerlayout = 3; + public new int titlebarlayout = 3; + public new int borderleftlayout = 3; + public new int borderrightlayout = 3; + public new int borderbottomlayout = 3; + public new int closebtnlayout = 3; + public new int rollbtnlayout = 3; + public new int minbtnlayout = 3; + public new int rightcornerlayout = 3; + public new int leftcornerlayout = 3; // Late entry: need to fix window code to include this - public int bottomleftcornerlayout = 3; - public int bottomrightcornerlayout = 3; - public Color bottomleftcornercolour = Color.Gray; + public new int bottomleftcornerlayout = 3; + public new int bottomrightcornerlayout = 3; + public new Color bottomleftcornercolour = Color.Gray; - public Color bottomrightcornercolour = Color.Gray; + public new Color bottomrightcornercolour = Color.Gray; - public bool enablebordercorners = false; + public new bool enablebordercorners = false; // settings - public Size closebtnsize = new Size(22, 22); - public Size rollbtnsize = new Size(22, 22); - public Size minbtnsize = new Size(22, 22); - public int titlebarheight = 30; - public int titlebariconsize = 16; - public int closebtnfromtop = 5; - public int closebtnfromside = 2; - public int rollbtnfromtop = 5; - public int rollbtnfromside = 26; - public int minbtnfromtop = 5; - public int minbtnfromside = 52; - public int borderwidth = 2; - public bool enablecorners = false; - public int titlebarcornerwidth = 5; - public int titleiconfromside = 4; - public int titleiconfromtop = 4; + public new Size closebtnsize = new Size(22, 22); + public new Size rollbtnsize = new Size(22, 22); + public new Size minbtnsize = new Size(22, 22); + public new int titlebarheight = 30; + public new int titlebariconsize = 16; + public new int closebtnfromtop = 5; + public new int closebtnfromside = 2; + public new int rollbtnfromtop = 5; + public new int rollbtnfromside = 26; + public new int minbtnfromtop = 5; + public new int minbtnfromside = 52; + public new int borderwidth = 2; + public new bool enablecorners = false; + public new int titlebarcornerwidth = 5; + public new int titleiconfromside = 4; + public new int titleiconfromtop = 4; //colours - public Color titlebarcolour = Color.Gray; - public Color borderleftcolour = Color.Gray; - public Color borderrightcolour = Color.Gray; - public Color borderbottomcolour = Color.Gray; - public Color closebtncolour = Color.Black; - public Color closebtnhovercolour = Color.Black; - public Color closebtnclickcolour = Color.Black; - public Color rollbtncolour = Color.Black; - public Color rollbtnhovercolour = Color.Black; - public Color rollbtnclickcolour = Color.Black; - public Color minbtncolour = Color.Black; - public Color minbtnhovercolour = Color.Black; - public Color minbtnclickcolour = Color.Black; - public Color rightcornercolour = Color.Gray; - public Color leftcornercolour = Color.Gray; + public new Color titlebarcolour = Color.Gray; + public new Color borderleftcolour = Color.Gray; + public new Color borderrightcolour = Color.Gray; + public new Color borderbottomcolour = Color.Gray; + public new Color closebtncolour = Color.Black; + public new Color closebtnhovercolour = Color.Black; + public new Color closebtnclickcolour = Color.Black; + public new Color rollbtncolour = Color.Black; + public new Color rollbtnhovercolour = Color.Black; + public new Color rollbtnclickcolour = Color.Black; + public new Color minbtncolour = Color.Black; + public new Color minbtnhovercolour = Color.Black; + public new Color minbtnclickcolour = Color.Black; + public new Color rightcornercolour = Color.Gray; + public new Color leftcornercolour = Color.Gray; // Text - public string titletextfontfamily = "Microsoft Sans Serif"; - public int titletextfontsize = 10; - public FontStyle titletextfontstyle = FontStyle.Bold; - public string titletextpos = "Left"; - public int titletextfromtop = 3; - public int titletextfromside = 24; + public new string titletextfontfamily = "Microsoft Sans Serif"; + public new int titletextfontsize = 10; + public new FontStyle titletextfontstyle = FontStyle.Bold; + public new string titletextpos = "Left"; + public new int titletextfromtop = 3; + public new int titletextfromside = 24; - public Color titletextcolour = Color.White; + public new Color titletextcolour = Color.White; //DESKTOP public Color desktoppanelcolour = Color.Gray; public Color desktopbackgroundcolour = Color.Black; @@ -572,6 +582,7 @@ public static void loadskin() { string panels = File.ReadAllText(Paths.LoadedSkin + "panels.json"); loadedSkin.DesktopPanels = JsonConvert.DeserializeObject>(panels); + Application.LoadSkin(loadedSkin); //Send the skin to ShiftUI so buttons and stuff get rendered with custom colors. LoadPanels(); } catch