mirror of
https://github.com/netfun2000/lcd4linux.git
synced 2026-02-27 09:44:34 +08:00
LCD::brightness in drv_X11 corrected
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@812 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
@@ -154,7 +154,8 @@ static int drv_X11_brightness(int brightness)
|
||||
col.G *= dim;
|
||||
col.B *= dim;
|
||||
|
||||
debug("%s: set backlight to %d%%, bl_col=0x%8x, dimmed=0x%8x", Name, (int)(dim * 100), BL_COL, col);
|
||||
debug("%s: set backlight to %d%%, original backlight color: 0x%02x%02x%02x%02x, dimmed: 0x%02x%02x%02x%02x",
|
||||
Name, (int)(dim * 100), BL_COL.R, BL_COL.G, BL_COL.B, BL_COL.A, col.R, col.G, col.B, col.A);
|
||||
for (i = 0; i < DCOLS * DROWS; i++) {
|
||||
drv_X11_FB[i] = col;
|
||||
}
|
||||
@@ -165,6 +166,9 @@ static int drv_X11_brightness(int brightness)
|
||||
XSetWindowBackground(dp, w, xc.pixel);
|
||||
XClearWindow(dp, w);
|
||||
|
||||
/* redraw every LCD pixel */
|
||||
drv_X11_blit(0, 0, LROWS, LCOLS);
|
||||
|
||||
return Brightness;
|
||||
}
|
||||
|
||||
@@ -242,7 +246,11 @@ static void drv_X11_expose(const int x, const int y, const int width, const int
|
||||
/* Keypad on the right side */
|
||||
if (x1 >= xoffset) {
|
||||
xfs = XQueryFont(dp, XGContextFromGC(DefaultGC(dp, 0)));
|
||||
drv_X11_color(FG_COL);
|
||||
if (drv_X11_brightness(-1) > 127) {
|
||||
drv_X11_color(FG_COL);
|
||||
} else {
|
||||
drv_X11_color(BG_COL);
|
||||
}
|
||||
for (r = 0; r < buttons; r++) {
|
||||
yk = yoffset + r * (btnheight + pgap);
|
||||
switch(r) {
|
||||
|
||||
Reference in New Issue
Block a user