From 79dfee0806060bf055d5532e3cdf57b5ad6159fe Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 19 Oct 2015 07:16:24 +0200 Subject: [PATCH 1/5] Typo --- src/gwin/gwin_textedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } From 288e928adebefb171f797e1ad5e62fbba2860788 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 19 Oct 2015 07:19:42 +0200 Subject: [PATCH 2/5] Adding boarder highlight if focused to button widget --- src/gwin/gwin_button.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 From 49c5300ccd2700a5e812da540c91d238c953b07b Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 19 Oct 2015 07:24:30 +0200 Subject: [PATCH 3/5] Fixing checkbox keyboard handler --- src/gwin/gwin_checkbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c index d477420b..78066567 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 From 3d618f8a7a55683c587399699891bb5a6880a0d3 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 19 Oct 2015 10:07:05 +0200 Subject: [PATCH 4/5] Adding boarder highlight if focused to checkbox widget --- src/gwin/gwin_checkbox.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c index 78066567..e0115608 100644 --- a/src/gwin/gwin_checkbox.c +++ b/src/gwin/gwin_checkbox.c @@ -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 From da2ee2d7adbfd47c87a0a30a1fecec767386503c Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 19 Oct 2015 22:04:30 +0200 Subject: [PATCH 5/5] Fixing compiler warning "assignment in condition" (ARMCC) --- src/gos/gos_x_heap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gos/gos_x_heap.c b/src/gos/gos_x_heap.c index 94b74d37..e8faa02f 100644 --- a/src/gos/gos_x_heap.c +++ b/src/gos/gos_x_heap.c @@ -154,7 +154,8 @@ } // We need to do this the hard way - if ((new = gfxAlloc(sz))) + new = gfxAlloc(sz); + if (new) return 0; memcpy(new, ptr, p->sz - sizeof(memslot)); gfxFree(ptr);