aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2015-10-20 13:39:04 +0200
committerJoel Bodenmann <joel@seriouslyembedded.com>2015-10-20 13:39:04 +0200
commitfbe7df300857bf3c327342f14316e59ba6c99e04 (patch)
tree7e457f6b14df3ad52b07d61aadcee214d96010ec /src
parenta111346fcd33752c268d8668c5ccefccfbba8e9b (diff)
parentda2ee2d7adbfd47c87a0a30a1fecec767386503c (diff)
downloaduGFX-fbe7df300857bf3c327342f14316e59ba6c99e04.tar.gz
uGFX-fbe7df300857bf3c327342f14316e59ba6c99e04.tar.bz2
uGFX-fbe7df300857bf3c327342f14316e59ba6c99e04.zip
Merge branch 'master' into Keil
Diffstat (limited to 'src')
-rw-r--r--src/gwin/gwin_button.c6
-rw-r--r--src/gwin/gwin_checkbox.c8
-rw-r--r--src/gwin/gwin_textedit.c2
3 files changed, 14 insertions, 2 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
diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c
index d477420b..e0115608 100644
--- a/src/gwin/gwin_checkbox.c
+++ b/src/gwin/gwin_checkbox.c
@@ -60,7 +60,7 @@ static void SendCheckboxEvent(GWidgetObject *gw) {
{
// Only react on KEYDOWN events. Ignore KEYUP events.
if (pke->keystate & GKEYSTATE_KEYUP) {
- break;
+ return;
}
// ENTER and SPACE keys to check/uncheck the checkbox
@@ -196,6 +196,9 @@ void gwinCheckboxDraw_CheckOnLeft(GWidgetObject *gw, void *param) {
if (gw->g.flags & GCHECKBOX_FLG_CHECKED)
gdispGFillArea(gw->g.display, gw->g.x+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill);
+ // Render highlighted border if focused
+ _gwidgetDrawFocusRect(gw, 1, 1, ld-2, ld-2);
+
// Draw the text
gdispGFillStringBox(gw->g.display, gw->g.x+ld+1, gw->g.y, gw->g.width-ld-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyLeft);
#undef gcw
@@ -225,6 +228,9 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
if (gw->g.flags & GCHECKBOX_FLG_CHECKED)
gdispGFillArea(gw->g.display, gw->g.x+ep+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill);
+ // Render highlighted border if focused
+ _gwidgetDrawFocusRect(gw, ep+1, 1, ld-2, ld-2);
+
// Draw the text
gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, ep-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyRight);
#undef gcw
diff --git a/src/gwin/gwin_textedit.c b/src/gwin/gwin_textedit.c
index ee147c84..d3dafe83 100644
--- a/src/gwin/gwin_textedit.c
+++ b/src/gwin/gwin_textedit.c
@@ -242,7 +242,7 @@ static void gwinTexteditDefaultDraw(GWidgetObject* gw, void* param)
// Render border
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, ccol);
- // Render highlighted border of focused
+ // Render highlighted border if focused
_gwidgetDrawFocusRect(gw, 1, 1, gw->g.width-2, gw->g.height-2);
}