aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2015-08-16 14:37:12 +0200
committerJoel Bodenmann <joel@seriouslyembedded.com>2015-08-16 14:37:12 +0200
commit058a873e9e425207db8b99be083e87cf956b9827 (patch)
treea849f322707da03f687fbc24f42dbcd1a279d67a
parenta569bbfc1eaf2ac67e151c27ee674107a589f93d (diff)
downloaduGFX-058a873e9e425207db8b99be083e87cf956b9827.tar.gz
uGFX-058a873e9e425207db8b99be083e87cf956b9827.tar.bz2
uGFX-058a873e9e425207db8b99be083e87cf956b9827.zip
Adding GWIN_FOCUS_HIGHLIGHT_WIDTH
-rw-r--r--docs/releases.txt1
-rw-r--r--gfxconf.example.h1
-rw-r--r--src/gwin/gwin_options.h7
-rw-r--r--src/gwin/gwin_widget.c7
4 files changed, 14 insertions, 2 deletions
diff --git a/docs/releases.txt b/docs/releases.txt
index 804f2c1b..c82119a7 100644
--- a/docs/releases.txt
+++ b/docs/releases.txt
@@ -14,6 +14,7 @@ FEATURE: Adding more font metrics (BaselineX and BaselineY)
FEATURE: Adding gdispGetStringWidthCount()
FEATURE: Adding TextEdit widget
FEATURE: Added color to widget style for focused widgets
+FEATURE: Added GWIN_FOCUS_HIGHLIGHT_WIDTH as an option in the configuration file
*** Release 2.3 ***
diff --git a/gfxconf.example.h b/gfxconf.example.h
index 1a54b8eb..0140c4fc 100644
--- a/gfxconf.example.h
+++ b/gfxconf.example.h
@@ -167,6 +167,7 @@
//#define GWIN_NEED_GL3D FALSE
//#define GWIN_NEED_WIDGET FALSE
+//#define GWIN_FOCUS_HIGHLIGHT_WIDTH 1
// #define GWIN_NEED_LABEL FALSE
// #define GWIN_LABEL_ATTRIBUTE FALSE
// #define GWIN_NEED_BUTTON FALSE
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
@@ -45,6 +45,13 @@
#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