Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

plugins: text viewer: use theme colors & backdrop

When Night Mode was added to Text Viewer
in ab1b67f, the regular mode was changed to
black and white instead of using theme colors.
This looks out of place in custom themes when
the statusbar is enabled, i.e. using the default
Text Viewer setting. Only switch to black and
white when statusbar is disabled, which also
disables the backdrop.

Change-Id: I3ff5e1c42de11ca58640e91bcb315ce7804fadcd

+25 -3
+25 -3
apps/plugins/text_viewer/tv_display.c
··· 196 196 display->set_drawmode(DRMODE_SOLID); 197 197 198 198 #if LCD_DEPTH > 1 199 - rb->lcd_set_backdrop(NULL); 199 + if (preferences->night_mode) 200 + rb->lcd_set_backdrop(NULL); 200 201 #endif 201 202 display->clear_viewport(); 202 203 ··· 338 339 void tv_night_mode(void) 339 340 { 340 341 #ifdef HAVE_LCD_COLOR 341 - if(preferences->night_mode) 342 + static unsigned int fg_color, bg_color; 343 + 344 + if (!fg_color && !bg_color) 345 + { 346 + /* Remember theme's UI viewport colors. Note: May 347 + be different from global_settings->fg|bg_color */ 348 + fg_color = rb->lcd_get_foreground(); 349 + bg_color = rb->lcd_get_background(); 350 + 351 + /* workaround for broken color schemes */ 352 + if (!fg_color && !bg_color) 353 + bg_color = LCD_WHITE; 354 + } 355 + 356 + if (preferences->night_mode) 342 357 { 343 358 rb->lcd_set_foreground(LCD_RGBPACK(0xBF,0xBF,0x00)); 344 359 rb->lcd_set_background(LCD_RGBPACK(0x96,0x0D,0x00)); 345 - }else 360 + } 361 + else if (preferences->statusbar) 362 + { 363 + /* Revert to theme colors */ 364 + rb->lcd_set_foreground(fg_color); 365 + rb->lcd_set_background(bg_color); 366 + } 367 + else 346 368 { 347 369 rb->lcd_set_foreground(LCD_WHITE); 348 370 rb->lcd_set_background(LCD_BLACK);