Adding GWIN_FOCUS_HIGHLIGHT_WIDTH
This commit is contained in:
parent
a569bbfc1e
commit
058a873e9e
@ -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 ***
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user