diff options
| author | Michael <[email protected]> | 2017-02-06 20:15:22 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-06 20:15:22 -0500 |
| commit | 82de84638ab857512181d5ed4ad0b5010bca1213 (patch) | |
| tree | d8fa96a1e185200c15f136b3dbb903a85b89221f /ShiftOS_TheReturn | |
| parent | aa9234c68130018f4ee3dbb40f54758536e9d101 (diff) | |
| download | shiftos_thereturn-82de84638ab857512181d5ed4ad0b5010bca1213.tar.gz shiftos_thereturn-82de84638ab857512181d5ed4ad0b5010bca1213.tar.bz2 shiftos_thereturn-82de84638ab857512181d5ed4ad0b5010bca1213.zip | |
Icon backend :D
Diffstat (limited to 'ShiftOS_TheReturn')
| -rw-r--r-- | ShiftOS_TheReturn/AppearanceManager.cs | 7 | ||||
| -rw-r--r-- | ShiftOS_TheReturn/Skinning.cs | 30 |
2 files changed, 36 insertions, 1 deletions
diff --git a/ShiftOS_TheReturn/AppearanceManager.cs b/ShiftOS_TheReturn/AppearanceManager.cs index 112bca5..dc88092 100644 --- a/ShiftOS_TheReturn/AppearanceManager.cs +++ b/ShiftOS_TheReturn/AppearanceManager.cs @@ -76,6 +76,11 @@ namespace ShiftOS.Engine } } + public static void SetWindowTitle(IShiftOSWindow window, string title) + { + winmgr.SetTitle(window, title); + } + public static IEnumerable<Type> GetAllWindowTypes() { List<Type> types = new List<Type>(); @@ -231,6 +236,8 @@ namespace ShiftOS.Engine public abstract void SetupDialog(IShiftOSWindow win); public abstract void InvokeAction(Action act); + + public abstract void SetTitle(IShiftOSWindow win, string title); } public interface IWindowBorder diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs index 3b618c1..d155688 100644 --- a/ShiftOS_TheReturn/Skinning.cs +++ b/ShiftOS_TheReturn/Skinning.cs @@ -112,6 +112,23 @@ namespace ShiftOS.Engine { public static void SaveSkin() { Utils.WriteAllText(Paths.GetPath("skin.json"), JsonConvert.SerializeObject(LoadedSkin, Formatting.Indented)); } + + public static Image GetIcon(string id) + { + if (!LoadedSkin.AppIcons.ContainsKey(id)) + LoadedSkin.AppIcons.Add(id, null); + + if (LoadedSkin.AppIcons[id] == null) + return new Bitmap(16, 16); + else + { + using (var sr = new MemoryStream(LoadedSkin.AppIcons[id])) + { + return Image.FromStream(sr); + } + } + + } } public class Skin { @@ -138,7 +155,11 @@ namespace ShiftOS.Engine { } [ShifterHidden] - public Dictionary<string, string> AppNames = new Dictionary<string, string>(); + public Dictionary<string, string> AppNames = new Dictionary<string, string>(); + + [ShifterHidden] + public Dictionary<string, byte[]> AppIcons = new Dictionary<string, byte[]>(); + [ShifterMeta("Windows")] [ShifterCategory("Titlebar")] @@ -914,6 +935,13 @@ namespace ShiftOS.Engine { //we DO NOT want this showing in the shifter. [ShifterHidden] public Dictionary<string, ImageLayout> SkinImageLayouts = new Dictionary<string, ImageLayout>(); + + [ShifterMeta("Windows")] + [ShifterCategory("Titlebar")] + [ShifterName("App icon from side")] + [ShifterDescription("How far from the side should the icon be?")] + [RequiresUpgrade("shift_titlebar;app_icons")] + public Point TitlebarIconFromSide = new Point(4,4); } public class ShifterHiddenAttribute : Attribute { |
