diff options
author | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2009-01-19 05:41:52 +0000 |
---|---|---|
committer | michael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2009-01-19 05:41:52 +0000 |
commit | d5ebee1188081526470467e9c9200ca56c0a7cea (patch) | |
tree | 47d38d1e7488bfeed205d523b4b7bdefa8c5a62d | |
parent | 06ad9f70dce10bdfb5c14d99fddc9bdb0796f016 (diff) | |
download | lcd4linux-d5ebee1188081526470467e9c9200ca56c0a7cea.tar.gz |
style 'H' (hollow) for vertical bars, individual bar colors for vertical bars fixed
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@977 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r-- | drv_generic_graphic.c | 21 | ||||
-rw-r--r-- | widget_bar.c | 5 |
2 files changed, 15 insertions, 11 deletions
diff --git a/drv_generic_graphic.c b/drv_generic_graphic.c index 76b778e..ba91123 100644 --- a/drv_generic_graphic.c +++ b/drv_generic_graphic.c @@ -476,16 +476,16 @@ int drv_generic_graphic_bar_draw(WIDGET * W) case DIR_EAST: for (y = 0; y < YRES; y++) { int val = y < YRES / 2 ? val1 : val2; - RGBA bcol = y < YRES / 2 ? bar[0] : bar[1]; + RGBA bc = y < YRES / 2 ? bar[0] : bar[1]; for (x = 0; x < max; x++) { if (x < val) - drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bg : bcol; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bg : bc; else - drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bcol : bg; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bc : bg; if (style) { - drv_generic_graphic_FB[layer][(row) * LCOLS + col + x] = fg; + drv_generic_graphic_FB[layer][(row + 0) * LCOLS + col + x] = fg; drv_generic_graphic_FB[layer][(row + YRES - 1) * LCOLS + col + x] = fg; } } @@ -504,11 +504,20 @@ int drv_generic_graphic_bar_draw(WIDGET * W) case DIR_SOUTH: for (x = 0; x < XRES; x++) { int val = x < XRES / 2 ? val1 : val2; + RGBA bc = x < XRES / 2 ? bar[0] : bar[1]; for (y = 0; y < max; y++) { if (y < val) - drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bg : fg; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bg : bc; else - drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? fg : bg; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bc : bg; + if (style) { + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + 0] = fg; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + XRES - 1] = fg; + } + } + if (style) { + drv_generic_graphic_FB[layer][(row + 0) * LCOLS + col + x] = fg; + drv_generic_graphic_FB[layer][(row + max - 1) * LCOLS + col + x] = fg; } } break; diff --git a/widget_bar.c b/widget_bar.c index 87dde85..7e453aa 100644 --- a/widget_bar.c +++ b/widget_bar.c @@ -176,11 +176,6 @@ int widget_bar_init(WIDGET * Self) switch (toupper(*c)) { case 'H': Bar->style = STYLE_HOLLOW; - if (!(Bar->direction & (DIR_EAST | DIR_WEST))) { - error("widget %s with style \"hollow\" not implemented for other directions than E(ast) or W(est)", - Self->name); - Bar->style = 0; - } break; case '0': Bar->style = 0; |