aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Tools/ShiftOSMenuRenderer.cs
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-05-28 12:37:00 -0700
committerGitHub <[email protected]>2017-05-28 12:37:00 -0700
commit771c20cfb3a703e0f1550fdcf9eb07b78298c944 (patch)
tree59cb532e15ebff313fdba2be264d78ec0033f407 /ShiftOS.WinForms/Tools/ShiftOSMenuRenderer.cs
parent496b0cbf8659c99203f48210fd39c572400ae623 (diff)
parentc7ba7d733c756d196f98dd4533289a1ef4db715f (diff)
downloadshiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.gz
shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.bz2
shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.zip
Merge pull request #1 from shiftos-game/master
welp, no longer a dev.
Diffstat (limited to 'ShiftOS.WinForms/Tools/ShiftOSMenuRenderer.cs')
-rw-r--r--ShiftOS.WinForms/Tools/ShiftOSMenuRenderer.cs55
1 files changed, 52 insertions, 3 deletions
diff --git a/ShiftOS.WinForms/Tools/ShiftOSMenuRenderer.cs b/ShiftOS.WinForms/Tools/ShiftOSMenuRenderer.cs
index 28623ef..81e8c89 100644
--- a/ShiftOS.WinForms/Tools/ShiftOSMenuRenderer.cs
+++ b/ShiftOS.WinForms/Tools/ShiftOSMenuRenderer.cs
@@ -28,16 +28,16 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
-using static ShiftOS.Engine.SkinEngine;
+using ShiftOS.Engine;
using System.Windows.Forms;
namespace ShiftOS.WinForms.Tools
{
public class ShiftOSMenuRenderer : ToolStripProfessionalRenderer
{
- public ShiftOSMenuRenderer() : base(new ShiftOSColorTable())
+ public ShiftOSMenuRenderer() : base(new ShiftOSColorTable(ShiftOS.Engine.SkinEngine.LoadedSkin))
{
-
+
}
public ShiftOSMenuRenderer(ProfessionalColorTable table) : base(table)
@@ -45,6 +45,26 @@ namespace ShiftOS.WinForms.Tools
}
+ public ShiftOSMenuRenderer(Skin skn) : base(new ShiftOSColorTable(skn))
+ {
+
+ }
+
+ public Skin LoadedSkin
+ {
+ get
+ {
+ if(ColorTable is ShiftOSColorTable)
+ {
+ return (ColorTable as ShiftOSColorTable).LoadedSkin;
+ }
+ else
+ {
+ return SkinEngine.LoadedSkin;
+ }
+ }
+ }
+
protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
{
if (e.Item.Tag?.ToString() == "applauncherbutton")
@@ -99,6 +119,18 @@ namespace ShiftOS.WinForms.Tools
public class ShiftOSColorTable : ProfessionalColorTable
{
+ public ShiftOSColorTable(ShiftOS.Engine.Skin skn)
+ {
+ LoadedSkin = skn;
+ }
+
+ public Skin LoadedSkin { get; private set; }
+
+ public Image GetImage(string id)
+ {
+ return SkinEngine.GetImage(id);
+ }
+
public override Color ButtonSelectedHighlight
{
get { return LoadedSkin.Menu_ButtonSelectedHighlight; }
@@ -327,6 +359,23 @@ namespace ShiftOS.WinForms.Tools
public class AppLauncherColorTable : ProfessionalColorTable
{
+ public Image GetImage(string id)
+ {
+ return SkinEngine.GetImage(id);
+ }
+
+ public AppLauncherColorTable()
+ {
+ LoadedSkin = SkinEngine.LoadedSkin;
+ }
+
+ public AppLauncherColorTable(Skin skn)
+ {
+ LoadedSkin = skn;
+ }
+
+ public Skin LoadedSkin { get; private set; }
+
public override Color ButtonSelectedHighlight
{
get { return LoadedSkin.Menu_ButtonSelectedHighlight; }