From 2adb8859edb95921e8f6d3cbb41fdc349825d6f8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 4 Jul 2017 17:57:29 -0400 Subject: abandon system.drawing for anything other than text --- ShiftOS.Frontend/GUI/Button.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'ShiftOS.Frontend/GUI/Button.cs') diff --git a/ShiftOS.Frontend/GUI/Button.cs b/ShiftOS.Frontend/GUI/Button.cs index 551d0d4..7d6804a 100644 --- a/ShiftOS.Frontend/GUI/Button.cs +++ b/ShiftOS.Frontend/GUI/Button.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using ShiftOS.Engine; +using ShiftOS.Frontend.GraphicsSubsystem; namespace ShiftOS.Frontend.GUI { @@ -31,19 +32,17 @@ namespace ShiftOS.Frontend.GUI } } - protected override void OnPaint(Graphics gfx) + protected override void OnPaint(GraphicsContext gfx) { - Color bgCol = SkinEngine.LoadedSkin.ButtonBackgroundColor; - Color fgCol = SkinEngine.LoadedSkin.ControlTextColor; + var bgCol = SkinEngine.LoadedSkin.ButtonBackgroundColor.ToMonoColor(); + var fgCol = SkinEngine.LoadedSkin.ControlTextColor.ToMonoColor(); if (ContainsMouse) - bgCol = SkinEngine.LoadedSkin.ButtonHoverColor; + bgCol = SkinEngine.LoadedSkin.ButtonHoverColor.ToMonoColor(); if (MouseLeftDown) - bgCol = SkinEngine.LoadedSkin.ButtonPressedColor; + bgCol = SkinEngine.LoadedSkin.ButtonPressedColor.ToMonoColor(); - gfx.Clear(bgCol); - gfx.DrawRectangle(new Pen(new SolidBrush(fgCol), SkinEngine.LoadedSkin.ButtonBorderWidth), new Rectangle(0, 0, Width, Height)); base.OnPaint(gfx); - + base.OnPaint(gfx); } } } -- cgit v1.2.3