aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin_button.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2015-10-19 07:19:42 +0200
committerJoel Bodenmann <joel@seriouslyembedded.com>2015-10-19 07:19:42 +0200
commit288e928adebefb171f797e1ad5e62fbba2860788 (patch)
treeee21bd309dcf6aa64e853c868fdf69f65800320c /src/gwin/gwin_button.c
parent79dfee0806060bf055d5532e3cdf57b5ad6159fe (diff)
downloaduGFX-288e928adebefb171f797e1ad5e62fbba2860788.tar.gz
uGFX-288e928adebefb171f797e1ad5e62fbba2860788.tar.bz2
uGFX-288e928adebefb171f797e1ad5e62fbba2860788.zip
Adding boarder highlight if focused to button widget
Diffstat (limited to 'src/gwin/gwin_button.c')
-rw-r--r--src/gwin/gwin_button.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gwin/gwin_button.c b/src/gwin/gwin_button.c
index 4d83348e..51b126b8 100644
--- a/src/gwin/gwin_button.c
+++ b/src/gwin/gwin_button.c
@@ -176,6 +176,9 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
gdispGDrawLine(gw->g.display, gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge);
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge);
+
+ // Render highlighted border if focused
+ _gwidgetDrawFocusRect(gw, 1, 1, gw->g.width-2, gw->g.height-2);
}
#else
void gwinButtonDraw_Normal(GWidgetObject *gw, void *param) {
@@ -199,6 +202,9 @@ static const GColorSet *getButtonColors(GWidgetObject *gw) {
gdispGDrawStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, justifyCenter);
gdispGDrawLine(gw->g.display, gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge);
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge);
+
+ // Render highlighted border if focused
+ _gwidgetDrawFocusRect(gw, 0, 0, gw->g.width-1, gw->g.height-1);
}
#endif