diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/line.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/apps/gui/line.c b/apps/gui/line.c index c06fc50f26..5a376c652c 100644 --- a/apps/gui/line.c +++ b/apps/gui/line.c | |||
@@ -306,7 +306,8 @@ static void style_line(struct screen *display, | |||
306 | break; | 306 | break; |
307 | } | 307 | } |
308 | #if (LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)) | 308 | #if (LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)) |
309 | /* fg color and bg color are left as-is for text drawing */ | 309 | /* prepare fg and bg colors for text drawing, be careful to not |
310 | * override any previously set colors unless mandated by the style */ | ||
310 | if (display->depth > 1) | 311 | if (display->depth > 1) |
311 | { | 312 | { |
312 | if (style & STYLE_COLORED) | 313 | if (style & STYLE_COLORED) |
@@ -318,8 +319,6 @@ static void style_line(struct screen *display, | |||
318 | } | 319 | } |
319 | else if (style & (STYLE_GRADIENT|STYLE_COLORBAR)) | 320 | else if (style & (STYLE_GRADIENT|STYLE_COLORBAR)) |
320 | display->set_foreground(line->text_color); | 321 | display->set_foreground(line->text_color); |
321 | else | ||
322 | display->set_foreground(get_viewport_default_colour(display->screen_type, true)); | ||
323 | } | 322 | } |
324 | #endif | 323 | #endif |
325 | } | 324 | } |
@@ -329,11 +328,23 @@ void vput_line(struct screen *display, | |||
329 | int x, int y, struct line_desc *line, | 328 | int x, int y, struct line_desc *line, |
330 | const char *fmt, va_list ap) | 329 | const char *fmt, va_list ap) |
331 | { | 330 | { |
331 | #if (LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)) | ||
332 | /* push and pop fg and bg colors as to not compromise unrelated lines */ | ||
333 | unsigned fg = 0, bg = 0; /* shut up gcc */ | ||
334 | if (display->depth > 1 && line->style > STYLE_INVERT) | ||
335 | { | ||
336 | fg = display->get_foreground(); | ||
337 | bg = display->get_background(); | ||
338 | } | ||
339 | #endif | ||
332 | style_line(display, x, y, line); | 340 | style_line(display, x, y, line); |
333 | print_line(display, x, y, line, fmt, ap); | 341 | print_line(display, x, y, line, fmt, ap); |
334 | #if (LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)) | 342 | #if (LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)) |
335 | if (display->depth > 1) | 343 | if (display->depth > 1 && line->style > STYLE_INVERT) |
336 | display->set_foreground(get_viewport_default_colour(display->screen_type, true)); | 344 | { |
345 | display->set_foreground(fg); | ||
346 | display->set_background(bg); | ||
347 | } | ||
337 | #endif | 348 | #endif |
338 | display->set_drawmode(DRMODE_SOLID); | 349 | display->set_drawmode(DRMODE_SOLID); |
339 | } | 350 | } |