diff options
| author | MichaelTheShifter <[email protected]> | 2016-07-23 15:25:46 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-07-23 15:25:46 -0400 |
| commit | dcb7c04de1ac07f7004af7d5af8450308ba2e29d (patch) | |
| tree | 15d583841b3a0484e690188c59e579a21ebac428 /source/WindowsFormsApplication1/SkinEngine | |
| parent | f8b13cfa2a571e982d8e52423b4d217ff79f62f6 (diff) | |
| download | shiftos-c--dcb7c04de1ac07f7004af7d5af8450308ba2e29d.tar.gz shiftos-c--dcb7c04de1ac07f7004af7d5af8450308ba2e29d.tar.bz2 shiftos-c--dcb7c04de1ac07f7004af7d5af8450308ba2e29d.zip | |
Fix panel buttons
Diffstat (limited to 'source/WindowsFormsApplication1/SkinEngine')
| -rw-r--r-- | source/WindowsFormsApplication1/SkinEngine/skins.cs | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/source/WindowsFormsApplication1/SkinEngine/skins.cs b/source/WindowsFormsApplication1/SkinEngine/skins.cs index d18770d..b9688ba 100644 --- a/source/WindowsFormsApplication1/SkinEngine/skins.cs +++ b/source/WindowsFormsApplication1/SkinEngine/skins.cs @@ -574,33 +574,45 @@ namespace Skinning /// </summary> public static void loadskin() { - if (Directory.Exists(Paths.LoadedSkin)) + try { - string rawData = File.ReadAllText(Paths.LoadedSkin + "data.json"); - loadedSkin = JsonConvert.DeserializeObject<Skin>(rawData); - if (File.Exists(Paths.LoadedSkin + "panels.json")) + if (Directory.Exists(Paths.LoadedSkin)) { - try - { - string panels = File.ReadAllText(Paths.LoadedSkin + "panels.json"); - loadedSkin.DesktopPanels = JsonConvert.DeserializeObject<List<DesktopPanel>>(panels); - Application.LoadSkin(loadedSkin); //Send the skin to ShiftUI so buttons and stuff get rendered with custom colors. - LoadPanels(); - } - catch + string rawData = File.ReadAllText(Paths.LoadedSkin + "data.json"); + loadedSkin = JsonConvert.DeserializeObject<Skin>(rawData); + if (File.Exists(Paths.LoadedSkin + "panels.json")) { + try + { + string panels = File.ReadAllText(Paths.LoadedSkin + "panels.json"); + loadedSkin.DesktopPanels = JsonConvert.DeserializeObject<List<DesktopPanel>>(panels); + Application.LoadSkin(loadedSkin); //Send the skin to ShiftUI so buttons and stuff get rendered with custom colors. + LoadPanels(); + } + catch + { + } } - } - loadimages(); - LoadEmbeddedNamePack(); + loadimages(); + LoadEmbeddedNamePack(); + } + else + { + loadedSkin = new Skin(); + Application.LoadSkin(loadedSkin); + loadedskin_images = new Images(); + saveskin(); + } } - else + catch { loadedSkin = new Skin(); + Application.LoadSkin(loadedSkin); loadedskin_images = new Images(); saveskin(); + } } |
