aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin_checkbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gwin/gwin_checkbox.c')
-rw-r--r--src/gwin/gwin_checkbox.c8
1 files changed, 7 insertions, 1 deletions
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