Mercurial > projects > dynamin
diff dynamin/gui/silver_theme.d @ 106:acdbb30fee7e
Port to D2.
Most of the effort was dealing with immutable and const.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Mon, 17 Dec 2012 23:41:50 -0600 |
parents | 5c8c1c2e12c0 |
children |
line wrap: on
line diff
--- a/dynamin/gui/silver_theme.d Sat Nov 24 10:21:50 2012 -0600 +++ b/dynamin/gui/silver_theme.d Mon Dec 17 23:41:50 2012 -0600 @@ -28,15 +28,15 @@ * - (150, 150, 150) */ class SilverTheme : Theme { - string name() { + override string name() { return "Silver"; } - void Window_paint(Window c, Graphics g) { + override void Window_paint(Window c, Graphics g) { g.source = Color.Silver; g.paint(); } - Size Button_bestSize(Button c) { + override Size Button_bestSize(Button c) { return Size(70, 25); } @@ -74,7 +74,7 @@ } //}}} - void Button_paint(Button c, Graphics g) { + override void Button_paint(Button c, Graphics g) { with(g) { drawButtonBack(g, 0, 0, c.width, c.height, c.state); source = _black; @@ -82,7 +82,7 @@ } } - void CheckBox_paint(CheckBox c, Graphics g) { + override void CheckBox_paint(CheckBox c, Graphics g) { with(g) { Point box = Point(2, cast(int)(c.height/2-6)); fontSize = 13; @@ -108,7 +108,7 @@ } } } - void RadioButton_paint(CheckBox c, Graphics g) { + override void RadioButton_paint(CheckBox c, Graphics g) { with(g) { int radius = 6; Point circle = Point(2, cast(int)(c.height/2-radius)); @@ -136,7 +136,7 @@ } } - void ScrollBarTrack_paint(ScrollBarTrack c, Graphics g) { + override void ScrollBarTrack_paint(ScrollBarTrack c, Graphics g) { if(c.state == ButtonState.Pressed) g.paint(); else if(isOdd(cast(int)round(c.x)) || isOdd(cast(int)round(c.y))) @@ -147,7 +147,7 @@ Color.Black, Color.White); } - void ScrollBarThumb_paint(ScrollBarThumb c, Graphics g) { + override void ScrollBarThumb_paint(ScrollBarThumb c, Graphics g) { with(g) { source = Color.White; paint(); @@ -157,20 +157,20 @@ } } - double ScrollBar_size() { + override double ScrollBar_size() { // TODO: all themes should get this from SystemGui.ScrollBarSize return 18; } - void ArrowButton_paint(ArrowButton c, Graphics g) { + override void ArrowButton_paint(ArrowButton c, Graphics g) { Button_paint(c, g); } - BorderSize Scrollable_borderSize(Scrollable c) { + override BorderSize Scrollable_borderSize(Scrollable c) { return BorderSize(1, 1, 1, 1); } - void Scrollable_paint(Scrollable c, Graphics g) { + override void Scrollable_paint(Scrollable c, Graphics g) { g.source = Color.White; g.paint(); g.source = Color.Black; @@ -178,15 +178,15 @@ g.stroke(); } - BorderSize Notebook_borderSize(Notebook c) { + override BorderSize Notebook_borderSize(Notebook c) { return BorderSize(1, 1, 1, 1); } - void Tab_paint(TabPage page, Notebook c, Graphics g){ + override void Tab_paint(TabPage page, Notebook c, Graphics g){ g.translate(page.tabLocation); g.drawText(page.text, 5, (page.tabSize.height-g.getTextExtents(page.text).height)/2); g.translate(-page.tabLocation); } - void Notebook_paint(Notebook c, Graphics g){} + override void Notebook_paint(Notebook c, Graphics g){} }