summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-10-03 14:19:30 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-10-03 14:19:30 +0000
commit0f8fe94f46b5c14b5f67b747131a5a66ed883e4c (patch)
tree858f0544f1fad5db8b7425d15c52e357c1842de3 /apps
parentc80dd635abb959646ed8c3262df591dfb189cd57 (diff)
downloadrockbox-0f8fe94f46b5c14b5f67b747131a5a66ed883e4c.zip
rockbox-0f8fe94f46b5c14b5f67b747131a5a66ed883e4c.tar.gz
rockbox-0f8fe94f46b5c14b5f67b747131a5a66ed883e4c.tar.bz2
rockbox-0f8fe94f46b5c14b5f67b747131a5a66ed883e4c.tar.xz
correct drawing of the bar type tags when nofill is set.
draw the slider bitmap before drawing A-B repeat markers so that they are visible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28204 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/scrollbar.c12
-rw-r--r--apps/gui/scrollbar.h1
-rw-r--r--apps/gui/skin_engine/skin_display.c70
3 files changed, 39 insertions, 44 deletions
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c
index 8f431a4..17d280b 100644
--- a/apps/gui/scrollbar.c
+++ b/apps/gui/scrollbar.c
@@ -151,6 +151,9 @@ void gui_scrollbar_draw(struct screen * screen, int x, int y,
screen->set_drawmode(DRMODE_SOLID);
+ if (flags & INNER_NOFILL)
+ return;
+
#ifdef HAVE_LCD_COLOR
if (infill == INNER_BGFILL)
{
@@ -190,7 +193,12 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
/* clear pixels in progress bar */
screen->fillrect(x, y, width, height);
-
+
+ screen->set_drawmode(DRMODE_SOLID);
+
+ if (flags & INNER_NOFILL)
+ return;
+
if (flags & INVERTFILL)
{
min_shown = items - max_shown;
@@ -204,8 +212,6 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
scrollbar_helper(min_shown, max_shown, items, inner_len, &size, &start);
- screen->set_drawmode(DRMODE_SOLID);
-
if (flags & HORIZONTAL) {
x += start;
width = size;
diff --git a/apps/gui/scrollbar.h b/apps/gui/scrollbar.h
index e5ffae7..31f91a3 100644
--- a/apps/gui/scrollbar.h
+++ b/apps/gui/scrollbar.h
@@ -29,6 +29,7 @@ enum orientation {
VERTICAL = 0x0000, /* Vertical orientation */
HORIZONTAL = 0x0001, /* Horizontal orientation */
INVERTFILL = 0x0002, /* Invert the fill direction */
+ INNER_NOFILL = 0x0004, /* Do not fill inner part */
#ifdef HAVE_LCD_COLOR
FOREGROUND = 0x0020, /* Do not clear background pixels */
INNER_FILL = 0x0040, /* Fill inner part even if FOREGROUND */
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 4c96782..91e8bbf 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -135,8 +135,6 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
unsigned long length, end;
int flags = HORIZONTAL;
- int drawn_length, drawn_end;
-
if (height < 0)
height = font_get(vp->font)->height;
@@ -180,17 +178,6 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
end = 0;
}
- if (pb->nofill)
- {
- drawn_length = 1;
- drawn_end = 0;
- }
- else
- {
- drawn_length = length;
- drawn_end = end;
- }
-
if (!pb->horizontal)
{
/* we want to fill upwards which is technically inverted. */
@@ -202,37 +189,19 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
flags ^= INVERTFILL;
}
-
+ if (pb->nofill)
+ {
+ flags |= INNER_NOFILL;
+ }
+
if (pb->have_bitmap_pb)
gui_bitmap_scrollbar_draw(display, &pb->bm,
pb->x, y, pb->width, pb->bm.height,
- drawn_length, 0, drawn_end, flags);
+ length, 0, end, flags);
else
gui_scrollbar_draw(display, pb->x, y, pb->width, height,
- drawn_length, 0, drawn_end, flags);
-
- if (pb->type == SKIN_TOKEN_PROGRESSBAR)
- {
- if (id3 && id3->length)
- {
-#ifdef AB_REPEAT_ENABLE
- if (ab_repeat_mode_enabled())
- ab_draw_markers(display, id3->length,
- pb->x, y, pb->width, height);
-#endif
+ length, 0, end, flags);
- if (id3->cuesheet)
- cue_draw_markers(display, id3->cuesheet, id3->length,
- pb->x, y+1, pb->width, height-2);
- }
-#if 0 /* disable for now CONFIG_TUNER */
- else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF))
- {
- presets_draw_markers(display, pb->x, y, pb->width, height);
- }
-#endif
- }
-
if (pb->slider)
{
int x = pb->x, y = pb->y;
@@ -267,6 +236,28 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
}
#endif
}
+
+ if (pb->type == SKIN_TOKEN_PROGRESSBAR)
+ {
+ if (id3 && id3->length)
+ {
+#ifdef AB_REPEAT_ENABLE
+ if (ab_repeat_mode_enabled())
+ ab_draw_markers(display, id3->length,
+ pb->x, y, pb->width, height);
+#endif
+
+ if (id3->cuesheet)
+ cue_draw_markers(display, id3->cuesheet, id3->length,
+ pb->x, y+1, pb->width, height-2);
+ }
+#if 0 /* disable for now CONFIG_TUNER */
+ else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF))
+ {
+ presets_draw_markers(display, pb->x, y, pb->width, height);
+ }
+#endif
+ }
}
/* clears the area where the image was shown */
@@ -783,6 +774,3 @@ int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout)
}
return button;
}
-
-
-