From 058a873e9e425207db8b99be083e87cf956b9827 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Sun, 16 Aug 2015 14:37:12 +0200 Subject: Adding GWIN_FOCUS_HIGHLIGHT_WIDTH --- src/gwin/gwin_options.h | 7 +++++++ src/gwin/gwin_widget.c | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/gwin') diff --git a/src/gwin/gwin_options.h b/src/gwin/gwin_options.h index 46bd92e7..45dfcd36 100644 --- a/src/gwin/gwin_options.h +++ b/src/gwin/gwin_options.h @@ -44,6 +44,13 @@ #ifndef GWIN_NEED_WIDGET #define GWIN_NEED_WIDGET FALSE #endif + /** + * @brief The width of the rectangle that highlights a widget that is focused + * @details Defaults to 1 + */ + #ifndef GWIN_FOCUS_HIGHLIGHT_WIDTH + #define GWIN_FOCUS_HIGHLIGHT_WIDTH 1 + #endif /** * @brief Should the simple container be included. * @details Defaults to FALSE diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c index fceb65c8..162d41e3 100644 --- a/src/gwin/gwin_widget.c +++ b/src/gwin/gwin_widget.c @@ -311,8 +311,11 @@ static void gwidgetEvent(void *param, GEvent *pe) { if (&gx->g != _widgetInFocus) return; - // Use the very simplest possible focus rectangle for now. - gdispGDrawBox(gx->g.display, gx->g.x+x, gx->g.y+y, cx, cy, gx->pstyle->focus); + // Use the very simplest possible focus rectangle for now + uint16_t i = 0; + for (i = 0; i < GWIN_FOCUS_HIGHLIGHT_WIDTH; i++) { + gdispGDrawBox(gx->g.display, gx->g.x+x+i, gx->g.y+y+i, cx-2*i, cy-2*i, gx->pstyle->focus); + } } #endif -- cgit v1.2.3