summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-10-09 11:00:40 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2022-10-09 11:00:40 -0400
commit70d5b2cd45b29e64ab17b04d995dce1080d7fca9 (patch)
tree14b14e162b84e220fbd10a6f7c3ac7ab9237783c
parentd73aaf3d9ec0f232c733f9330d38cdec55d9264d (diff)
downloadrockbox-70d5b2cd45.tar.gz
rockbox-70d5b2cd45.zip
splash_progress fix red for non-color targets
Change-Id: I6a50264a8edb2745c3d5ecd3cd558c0e83e4a529
-rw-r--r--apps/gui/splash.c15
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,
int x = 0;
int y, i;
int space_w, w, h;
-
int width, height;
int maxw = 0;
@@ -198,6 +197,7 @@ void splash(int ticks, const char *str)
/* splash a progress meter */
void splash_progress(int current, int total, const char *fmt, ...)
{
+ va_list ap;
int vp_flag = VP_FLAG_VP_DIRTY;
/* progress update tick */
static long next_tick = 0;
@@ -212,8 +212,6 @@ void splash_progress(int current, int total, const char *fmt, ...)
vp_flag = 0; /* don't mark vp dirty to prevent flashing */
}
- va_list ap;
-
/* If fmt is a lang ID then get the corresponding string (which
still might contain % place holders). */
fmt = P2STR((unsigned char *)fmt);
@@ -228,11 +226,16 @@ void splash_progress(int current, int total, const char *fmt, ...)
if (splash_internal(screen, fmt, ap, &vp, 1))
{
int size = screen->getcharheight();
+ int x = RECT_SPACING;
int y = vp.height - size - RECT_SPACING;
int w = vp.width - RECT_SPACING * 2;
-
- gui_scrollbar_draw(screen, RECT_SPACING, y, w, size,
- total, 0, current, HORIZONTAL | FOREGROUND);
+ int h = size;
+#ifdef HAVE_LCD_COLOR
+ const int sb_flags = HORIZONTAL | FOREGROUND;
+#else
+ const int sb_flags = HORIZONTAL;
+#endif
+ gui_scrollbar_draw(screen, x, y, w, h, total, 0, current, sb_flags);
screen->update_viewport();
}