aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-08-16 23:34:46 +1000
committerinmarket <andrewh@inmarket.com.au>2014-08-16 23:34:46 +1000
commit045140a1338cbff569081ad89c06c09ffa216534 (patch)
treee40d8deaa7c58d673b4292fc9420d01d03a12285 /src
parent87c2793248d6ed350699d6cad9296f4941a2a1f3 (diff)
downloaduGFX-045140a1338cbff569081ad89c06c09ffa216534.tar.gz
uGFX-045140a1338cbff569081ad89c06c09ffa216534.tar.bz2
uGFX-045140a1338cbff569081ad89c06c09ffa216534.zip
frame window fixes
Diffstat (limited to 'src')
-rw-r--r--src/gwin/frame.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gwin/frame.c b/src/gwin/frame.c
index 9dc06507..ec0bf632 100644
--- a/src/gwin/frame.c
+++ b/src/gwin/frame.c
@@ -124,10 +124,10 @@ static void forceFrameRedraw(GWidgetObject *gw) {
pos = gw->g.width - (BORDER_R+BUTTON_X);
if ((gw->g.flags & GWIN_FRAME_CLOSE_BTN)) {
if ((gw->g.flags & GWIN_FRAME_CLOSE_PRESSED) && x >= pos && x <= pos+BUTTON_X) {
- // Close is released - destroy the window
+ // Close is released - destroy the window. This is tricky as we already have the drawing lock.
gw->g.flags &= ~(GWIN_FRAME_CLOSE_PRESSED|GWIN_FRAME_MAX_PRESSED|GWIN_FRAME_MIN_PRESSED);
forceFrameRedraw(gw);
- gwinDestroy(&gw->g);
+ _gwinDestroy(&gw->g, REDRAW_INSESSION);
return;
}
pos -= BUTTON_X;
@@ -225,6 +225,7 @@ void gwinFrameDraw_Transparent(GWidgetObject *gw, void *param) {
const GColorSet *pcol;
coord_t pos;
color_t contrast;
+ color_t btn;
(void)param;
if (gw->g.vmt != (gwinVMT *)&frameVMT)
@@ -232,6 +233,7 @@ void gwinFrameDraw_Transparent(GWidgetObject *gw, void *param) {
pcol = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->enabled : &gw->pstyle->disabled;
contrast = gdispContrastColor(pcol->edge);
+ btn = gdispBlendColor(pcol->edge, contrast, 128);
// Render the frame
gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, BORDER_T, gw->text, gw->g.font, contrast, pcol->edge, justifyCenter);
@@ -244,7 +246,7 @@ void gwinFrameDraw_Transparent(GWidgetObject *gw, void *param) {
if ((gw->g.flags & GWIN_FRAME_CLOSE_BTN)) {
if ((gw->g.flags & GWIN_FRAME_CLOSE_PRESSED))
- gdispFillArea(pos, gw->g.y+BUTTON_T, BUTTON_X, BUTTON_Y, gdispBlendColor(pcol->edge, contrast, 192));
+ gdispFillArea(pos, gw->g.y+BUTTON_T, BUTTON_X, BUTTON_Y, btn);
gdispDrawLine(pos+BUTTON_I, gw->g.y+(BUTTON_T+BUTTON_I), pos+(BUTTON_X-BUTTON_I-1), gw->g.y+(BUTTON_T+BUTTON_Y-BUTTON_I-1), contrast);
gdispDrawLine(pos+(BUTTON_X-BUTTON_I-1), gw->g.y+(BUTTON_T+BUTTON_I), pos+BUTTON_I, gw->g.y+(BUTTON_T+BUTTON_Y-BUTTON_I-1), contrast);
pos -= BUTTON_X;
@@ -252,14 +254,14 @@ void gwinFrameDraw_Transparent(GWidgetObject *gw, void *param) {
if ((gw->g.flags & GWIN_FRAME_MINMAX_BTN)) {
if ((gw->g.flags & GWIN_FRAME_MAX_PRESSED))
- gdispFillArea(pos, gw->g.y+BUTTON_T, BUTTON_X, BUTTON_Y, gdispBlendColor(pcol->edge, contrast, 192));
+ gdispFillArea(pos, gw->g.y+BUTTON_T, BUTTON_X, BUTTON_Y, btn);
// the symbol
gdispDrawBox(pos+BUTTON_I, gw->g.y+(BUTTON_T+BUTTON_I), BUTTON_X-2*BUTTON_I, BUTTON_Y-2*BUTTON_I, contrast);
gdispDrawLine(pos+(BUTTON_I+1), gw->g.y+(BUTTON_T+BUTTON_I+1), pos+(BUTTON_X-BUTTON_I-2), gw->g.y+(BUTTON_T+BUTTON_I+1), contrast);
gdispDrawLine(pos+(BUTTON_I+1), gw->g.y+(BUTTON_T+BUTTON_I+2), pos+(BUTTON_X-BUTTON_I-2), gw->g.y+(BUTTON_T+BUTTON_I+2), contrast);
pos -= BUTTON_X;
if ((gw->g.flags & GWIN_FRAME_MIN_PRESSED))
- gdispFillArea(pos, gw->g.y+BUTTON_T, BUTTON_X, BUTTON_Y, gdispBlendColor(pcol->edge, contrast, 192));
+ gdispFillArea(pos, gw->g.y+BUTTON_T, BUTTON_X, BUTTON_Y, btn);
gdispDrawLine(pos+BUTTON_I, gw->g.y+(BUTTON_T+BUTTON_Y-BUTTON_I-1), pos+(BUTTON_X-BUTTON_I-1), gw->g.y+(BUTTON_T+BUTTON_Y-BUTTON_I-1), contrast);
pos -= BUTTON_X;
}
@@ -300,8 +302,8 @@ void gwinFrameDraw_Std(GWidgetObject *gw, void *param) {
return;
// Draw the client area by tiling the image
- mx = gw->x+gw->g.width - BORDER_R;
- my = gw->y+gw->g.height - BORDER_B;
+ mx = gw->g.x+gw->g.width - BORDER_R;
+ my = gw->g.y+gw->g.height - BORDER_B;
for(y = gw->g.y+BORDER_T, ih=gi->height; y < my; y += ih) {
if (ih > my - y)
ih = my - y;