From 68362b4c6fe2e740ac02f7b4cb1ae77de3cfbd09 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 3 Jul 2017 08:55:21 -0400 Subject: major optimizations, draggable windows --- ShiftOS.Frontend/GUI/Button.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ShiftOS.Frontend/GUI/Button.cs') diff --git a/ShiftOS.Frontend/GUI/Button.cs b/ShiftOS.Frontend/GUI/Button.cs index c2e41a3..551d0d4 100644 --- a/ShiftOS.Frontend/GUI/Button.cs +++ b/ShiftOS.Frontend/GUI/Button.cs @@ -25,14 +25,13 @@ namespace ShiftOS.Frontend.GUI using (var gfx = Graphics.FromImage(new Bitmap(1, 1))) { var measure = gfx.MeasureString(this.Text, this.Font); - Width = borderwidth + (int)measure.Width + 4; - Height = borderwidth + (int)measure.Height + 8; + Width = borderwidth + (int)measure.Width + 16; + Height = borderwidth + (int)measure.Height + 12; } } - base.OnLayout(); } - public override void Paint(Graphics gfx) + protected override void OnPaint(Graphics gfx) { Color bgCol = SkinEngine.LoadedSkin.ButtonBackgroundColor; Color fgCol = SkinEngine.LoadedSkin.ControlTextColor; @@ -43,7 +42,7 @@ namespace ShiftOS.Frontend.GUI gfx.Clear(bgCol); gfx.DrawRectangle(new Pen(new SolidBrush(fgCol), SkinEngine.LoadedSkin.ButtonBorderWidth), new Rectangle(0, 0, Width, Height)); - base.Paint(gfx); + base.OnPaint(gfx); } } -- cgit v1.2.3