diff options
| author | Michael <[email protected]> | 2017-07-03 08:55:21 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-07-03 08:55:21 -0400 |
| commit | 68362b4c6fe2e740ac02f7b4cb1ae77de3cfbd09 (patch) | |
| tree | a346b092eee671ab9fae32cbca23d22b171c748b /ShiftOS.Frontend/GUI/Button.cs | |
| parent | 6f3a5cba2ea08ea6f442e2336b74f32f4bbc0604 (diff) | |
| download | shiftos_thereturn-68362b4c6fe2e740ac02f7b4cb1ae77de3cfbd09.tar.gz shiftos_thereturn-68362b4c6fe2e740ac02f7b4cb1ae77de3cfbd09.tar.bz2 shiftos_thereturn-68362b4c6fe2e740ac02f7b4cb1ae77de3cfbd09.zip | |
major optimizations, draggable windows
Diffstat (limited to 'ShiftOS.Frontend/GUI/Button.cs')
| -rw-r--r-- | ShiftOS.Frontend/GUI/Button.cs | 9 |
1 files changed, 4 insertions, 5 deletions
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); } } |
