From 6b804f03ebcdd1c5aa145f29ae71b62bd61f8cb9 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Tue, 19 Jul 2016 21:53:26 -0400 Subject: Full ShiftUI conversion The only bugs are that windows don't show in the center of the screen, and Gecko webbrowsers are not serializing properly to be converted to ShiftUI widgets (you can use the ToWidget() extension method to convert a WinForms control to a ShiftUI widget) Also multiple desktop panels are removed due to some odd bug I can't diagnose. Will add them back in the future. Promise. I loved creating GNOME2 skins. --- .../SkinEngine/ShiftOSColorTable.cs | 2 +- .../SkinEngine/WindowComposition.cs | 6 +++--- source/WindowsFormsApplication1/SkinEngine/skins.cs | 15 +++++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) (limited to 'source/WindowsFormsApplication1/SkinEngine') diff --git a/source/WindowsFormsApplication1/SkinEngine/ShiftOSColorTable.cs b/source/WindowsFormsApplication1/SkinEngine/ShiftOSColorTable.cs index f74b7c2..fdf840b 100644 --- a/source/WindowsFormsApplication1/SkinEngine/ShiftOSColorTable.cs +++ b/source/WindowsFormsApplication1/SkinEngine/ShiftOSColorTable.cs @@ -4,7 +4,7 @@ // using System.Drawing; -using System.Windows.Forms; +using ShiftUI; namespace ShiftOS { diff --git a/source/WindowsFormsApplication1/SkinEngine/WindowComposition.cs b/source/WindowsFormsApplication1/SkinEngine/WindowComposition.cs index 18fe2d1..99fd813 100644 --- a/source/WindowsFormsApplication1/SkinEngine/WindowComposition.cs +++ b/source/WindowsFormsApplication1/SkinEngine/WindowComposition.cs @@ -5,7 +5,7 @@ using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Windows.Forms; +using ShiftUI; namespace ShiftOS { @@ -13,7 +13,7 @@ namespace ShiftOS { private static bool _CanClose = true; public static bool ShuttingDown = false; - public static bool SafeToAddControls = true; + public static bool SafeToAddWidgets = true; public static bool CanClose { @@ -57,7 +57,7 @@ namespace ShiftOS t.Start(); } - public static void ScaleWidget(Control ctrl, int width, int height) + public static void ScaleWidget(Widget ctrl, int width, int height) { ctrl.Size = new Size(0, 0); var t = new Timer(); diff --git a/source/WindowsFormsApplication1/SkinEngine/skins.cs b/source/WindowsFormsApplication1/SkinEngine/skins.cs index 8dcaea2..72f5021 100644 --- a/source/WindowsFormsApplication1/SkinEngine/skins.cs +++ b/source/WindowsFormsApplication1/SkinEngine/skins.cs @@ -4,7 +4,7 @@ using Newtonsoft.Json; using System; using ShiftOS; using System.IO.Compression; -using System.Windows.Forms; +using ShiftUI; using System.Collections.Generic; using System.Drawing.Imaging; @@ -568,9 +568,16 @@ namespace Skinning loadedSkin = JsonConvert.DeserializeObject(rawData); if (File.Exists(Paths.LoadedSkin + "panels.json")) { - string panels = File.ReadAllText(Paths.LoadedSkin + "panels.json"); - loadedSkin.DesktopPanels = JsonConvert.DeserializeObject>(panels); - LoadPanels(); + try + { + string panels = File.ReadAllText(Paths.LoadedSkin + "panels.json"); + loadedSkin.DesktopPanels = JsonConvert.DeserializeObject>(panels); + LoadPanels(); + } + catch + { + + } } loadimages(); LoadEmbeddedNamePack(); -- cgit v1.2.3