aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/button.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-05-01 16:44:11 +1000
committerinmarket <andrewh@inmarket.com.au>2014-05-01 16:44:11 +1000
commit558ee7282d9f753519d7a813f1b9206c31e6f247 (patch)
tree0c3844b0523ad410e4b771da39a35fc611110e28 /src/gwin/button.c
parent8f6c04e12027c88ad8e8d31cc5d29806dd0424ba (diff)
downloaduGFX-558ee7282d9f753519d7a813f1b9206c31e6f247.tar.gz
uGFX-558ee7282d9f753519d7a813f1b9206c31e6f247.tar.bz2
uGFX-558ee7282d9f753519d7a813f1b9206c31e6f247.zip
Make some GWIN constants into #defines
Diffstat (limited to 'src/gwin/button.c')
-rw-r--r--src/gwin/button.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gwin/button.c b/src/gwin/button.c
index 59c7f689..f34e4ba3 100644
--- a/src/gwin/button.c
+++ b/src/gwin/button.c
@@ -25,6 +25,8 @@
#define RND_CNR_SIZE 5 // Rounded corner size for rounded buttons
#define ARROWHEAD_DIVIDER 4 // A quarter of the height for the arrow head
#define ARROWBODY_DIVIDER 4 // A quarter of the width for the arrow body
+#define TOP_FADE 50 // (TOP_FADE/255)% fade to white for top of button
+#define BOTTOM_FADE 25 // (BOTTOM_FADE/255)% fade to black for bottom of button
// Our pressed state
#define GBUTTON_FLG_PRESSED (GWIN_FIRST_CONTROL_FLAG<<0)
@@ -189,8 +191,8 @@ static const GColorSet *getDrawColors(GWidgetObject *gw) {
pcol = getDrawColors(gw);
/* Fill the box blended from variants of the fill color */
- tcol = gdispBlendColor(White, pcol->fill, 50);
- bcol = gdispBlendColor(Black, pcol->fill, 25);
+ tcol = gdispBlendColor(White, pcol->fill, TOP_FADE);
+ bcol = gdispBlendColor(Black, pcol->fill, BOTTOM_FADE);
dalpha = FIXED(255)/gw->g.height;
for(alpha = 0, i = 0; i < gw->g.height; i++, alpha += dalpha)
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+i, gw->g.x+gw->g.width-2, gw->g.y+i, gdispBlendColor(bcol, tcol, NONFIXED(alpha)));