diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-10-09 11:00:40 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2022-10-09 11:00:40 -0400 |
commit | 70d5b2cd45b29e64ab17b04d995dce1080d7fca9 (patch) | |
tree | 14b14e162b84e220fbd10a6f7c3ac7ab9237783c /apps/gui/splash.c | |
parent | d73aaf3d9ec0f232c733f9330d38cdec55d9264d (diff) | |
download | rockbox-70d5b2cd45b29e64ab17b04d995dce1080d7fca9.tar.gz rockbox-70d5b2cd45b29e64ab17b04d995dce1080d7fca9.zip |
splash_progress fix red for non-color targets
Change-Id: I6a50264a8edb2745c3d5ecd3cd558c0e83e4a529
Diffstat (limited to 'apps/gui/splash.c')
-rw-r--r-- | apps/gui/splash.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/gui/splash.c b/apps/gui/splash.c index bf9647cff1..5bb8514d30 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c | |||
@@ -49,7 +49,6 @@ static bool splash_internal(struct screen * screen, const char *fmt, va_list ap, | |||
49 | int x = 0; | 49 | int x = 0; |
50 | int y, i; | 50 | int y, i; |
51 | int space_w, w, h; | 51 | int space_w, w, h; |
52 | |||
53 | int width, height; | 52 | int width, height; |
54 | int maxw = 0; | 53 | int maxw = 0; |
55 | 54 | ||
@@ -198,6 +197,7 @@ void splash(int ticks, const char *str) | |||
198 | /* splash a progress meter */ | 197 | /* splash a progress meter */ |
199 | void splash_progress(int current, int total, const char *fmt, ...) | 198 | void splash_progress(int current, int total, const char *fmt, ...) |
200 | { | 199 | { |
200 | va_list ap; | ||
201 | int vp_flag = VP_FLAG_VP_DIRTY; | 201 | int vp_flag = VP_FLAG_VP_DIRTY; |
202 | /* progress update tick */ | 202 | /* progress update tick */ |
203 | static long next_tick = 0; | 203 | static long next_tick = 0; |
@@ -212,8 +212,6 @@ void splash_progress(int current, int total, const char *fmt, ...) | |||
212 | vp_flag = 0; /* don't mark vp dirty to prevent flashing */ | 212 | vp_flag = 0; /* don't mark vp dirty to prevent flashing */ |
213 | } | 213 | } |
214 | 214 | ||
215 | va_list ap; | ||
216 | |||
217 | /* If fmt is a lang ID then get the corresponding string (which | 215 | /* If fmt is a lang ID then get the corresponding string (which |
218 | still might contain % place holders). */ | 216 | still might contain % place holders). */ |
219 | fmt = P2STR((unsigned char *)fmt); | 217 | fmt = P2STR((unsigned char *)fmt); |
@@ -228,11 +226,16 @@ void splash_progress(int current, int total, const char *fmt, ...) | |||
228 | if (splash_internal(screen, fmt, ap, &vp, 1)) | 226 | if (splash_internal(screen, fmt, ap, &vp, 1)) |
229 | { | 227 | { |
230 | int size = screen->getcharheight(); | 228 | int size = screen->getcharheight(); |
229 | int x = RECT_SPACING; | ||
231 | int y = vp.height - size - RECT_SPACING; | 230 | int y = vp.height - size - RECT_SPACING; |
232 | int w = vp.width - RECT_SPACING * 2; | 231 | int w = vp.width - RECT_SPACING * 2; |
233 | 232 | int h = size; | |
234 | gui_scrollbar_draw(screen, RECT_SPACING, y, w, size, | 233 | #ifdef HAVE_LCD_COLOR |
235 | total, 0, current, HORIZONTAL | FOREGROUND); | 234 | const int sb_flags = HORIZONTAL | FOREGROUND; |
235 | #else | ||
236 | const int sb_flags = HORIZONTAL; | ||
237 | #endif | ||
238 | gui_scrollbar_draw(screen, x, y, w, h, total, 0, current, sb_flags); | ||
236 | 239 | ||
237 | screen->update_viewport(); | 240 | screen->update_viewport(); |
238 | } | 241 | } |