diff options
-rw-r--r-- | apps/gui/scrollbar.c | 12 | ||||
-rw-r--r-- | apps/gui/scrollbar.h | 1 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 70 |
3 files changed, 39 insertions, 44 deletions
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c index 8f431a4ff8..17d280b1ca 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, | |||
151 | 151 | ||
152 | screen->set_drawmode(DRMODE_SOLID); | 152 | screen->set_drawmode(DRMODE_SOLID); |
153 | 153 | ||
154 | if (flags & INNER_NOFILL) | ||
155 | return; | ||
156 | |||
154 | #ifdef HAVE_LCD_COLOR | 157 | #ifdef HAVE_LCD_COLOR |
155 | if (infill == INNER_BGFILL) | 158 | if (infill == INNER_BGFILL) |
156 | { | 159 | { |
@@ -190,7 +193,12 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x, | |||
190 | 193 | ||
191 | /* clear pixels in progress bar */ | 194 | /* clear pixels in progress bar */ |
192 | screen->fillrect(x, y, width, height); | 195 | screen->fillrect(x, y, width, height); |
193 | 196 | ||
197 | screen->set_drawmode(DRMODE_SOLID); | ||
198 | |||
199 | if (flags & INNER_NOFILL) | ||
200 | return; | ||
201 | |||
194 | if (flags & INVERTFILL) | 202 | if (flags & INVERTFILL) |
195 | { | 203 | { |
196 | min_shown = items - max_shown; | 204 | min_shown = items - max_shown; |
@@ -204,8 +212,6 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x, | |||
204 | 212 | ||
205 | scrollbar_helper(min_shown, max_shown, items, inner_len, &size, &start); | 213 | scrollbar_helper(min_shown, max_shown, items, inner_len, &size, &start); |
206 | 214 | ||
207 | screen->set_drawmode(DRMODE_SOLID); | ||
208 | |||
209 | if (flags & HORIZONTAL) { | 215 | if (flags & HORIZONTAL) { |
210 | x += start; | 216 | x += start; |
211 | width = size; | 217 | width = size; |
diff --git a/apps/gui/scrollbar.h b/apps/gui/scrollbar.h index e5ffae79b0..31f91a3eaa 100644 --- a/apps/gui/scrollbar.h +++ b/apps/gui/scrollbar.h | |||
@@ -29,6 +29,7 @@ enum orientation { | |||
29 | VERTICAL = 0x0000, /* Vertical orientation */ | 29 | VERTICAL = 0x0000, /* Vertical orientation */ |
30 | HORIZONTAL = 0x0001, /* Horizontal orientation */ | 30 | HORIZONTAL = 0x0001, /* Horizontal orientation */ |
31 | INVERTFILL = 0x0002, /* Invert the fill direction */ | 31 | INVERTFILL = 0x0002, /* Invert the fill direction */ |
32 | INNER_NOFILL = 0x0004, /* Do not fill inner part */ | ||
32 | #ifdef HAVE_LCD_COLOR | 33 | #ifdef HAVE_LCD_COLOR |
33 | FOREGROUND = 0x0020, /* Do not clear background pixels */ | 34 | FOREGROUND = 0x0020, /* Do not clear background pixels */ |
34 | INNER_FILL = 0x0040, /* Fill inner part even if FOREGROUND */ | 35 | 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 4c96782280..91e8bbfafc 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) | |||
135 | unsigned long length, end; | 135 | unsigned long length, end; |
136 | int flags = HORIZONTAL; | 136 | int flags = HORIZONTAL; |
137 | 137 | ||
138 | int drawn_length, drawn_end; | ||
139 | |||
140 | if (height < 0) | 138 | if (height < 0) |
141 | height = font_get(vp->font)->height; | 139 | height = font_get(vp->font)->height; |
142 | 140 | ||
@@ -180,17 +178,6 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) | |||
180 | end = 0; | 178 | end = 0; |
181 | } | 179 | } |
182 | 180 | ||
183 | if (pb->nofill) | ||
184 | { | ||
185 | drawn_length = 1; | ||
186 | drawn_end = 0; | ||
187 | } | ||
188 | else | ||
189 | { | ||
190 | drawn_length = length; | ||
191 | drawn_end = end; | ||
192 | } | ||
193 | |||
194 | if (!pb->horizontal) | 181 | if (!pb->horizontal) |
195 | { | 182 | { |
196 | /* we want to fill upwards which is technically inverted. */ | 183 | /* 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) | |||
202 | flags ^= INVERTFILL; | 189 | flags ^= INVERTFILL; |
203 | } | 190 | } |
204 | 191 | ||
205 | 192 | if (pb->nofill) | |
193 | { | ||
194 | flags |= INNER_NOFILL; | ||
195 | } | ||
196 | |||
206 | if (pb->have_bitmap_pb) | 197 | if (pb->have_bitmap_pb) |
207 | gui_bitmap_scrollbar_draw(display, &pb->bm, | 198 | gui_bitmap_scrollbar_draw(display, &pb->bm, |
208 | pb->x, y, pb->width, pb->bm.height, | 199 | pb->x, y, pb->width, pb->bm.height, |
209 | drawn_length, 0, drawn_end, flags); | 200 | length, 0, end, flags); |
210 | else | 201 | else |
211 | gui_scrollbar_draw(display, pb->x, y, pb->width, height, | 202 | gui_scrollbar_draw(display, pb->x, y, pb->width, height, |
212 | drawn_length, 0, drawn_end, flags); | 203 | length, 0, end, flags); |
213 | |||
214 | if (pb->type == SKIN_TOKEN_PROGRESSBAR) | ||
215 | { | ||
216 | if (id3 && id3->length) | ||
217 | { | ||
218 | #ifdef AB_REPEAT_ENABLE | ||
219 | if (ab_repeat_mode_enabled()) | ||
220 | ab_draw_markers(display, id3->length, | ||
221 | pb->x, y, pb->width, height); | ||
222 | #endif | ||
223 | 204 | ||
224 | if (id3->cuesheet) | ||
225 | cue_draw_markers(display, id3->cuesheet, id3->length, | ||
226 | pb->x, y+1, pb->width, height-2); | ||
227 | } | ||
228 | #if 0 /* disable for now CONFIG_TUNER */ | ||
229 | else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) | ||
230 | { | ||
231 | presets_draw_markers(display, pb->x, y, pb->width, height); | ||
232 | } | ||
233 | #endif | ||
234 | } | ||
235 | |||
236 | if (pb->slider) | 205 | if (pb->slider) |
237 | { | 206 | { |
238 | int x = pb->x, y = pb->y; | 207 | int x = pb->x, y = pb->y; |
@@ -267,6 +236,28 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) | |||
267 | } | 236 | } |
268 | #endif | 237 | #endif |
269 | } | 238 | } |
239 | |||
240 | if (pb->type == SKIN_TOKEN_PROGRESSBAR) | ||
241 | { | ||
242 | if (id3 && id3->length) | ||
243 | { | ||
244 | #ifdef AB_REPEAT_ENABLE | ||
245 | if (ab_repeat_mode_enabled()) | ||
246 | ab_draw_markers(display, id3->length, | ||
247 | pb->x, y, pb->width, height); | ||
248 | #endif | ||
249 | |||
250 | if (id3->cuesheet) | ||
251 | cue_draw_markers(display, id3->cuesheet, id3->length, | ||
252 | pb->x, y+1, pb->width, height-2); | ||
253 | } | ||
254 | #if 0 /* disable for now CONFIG_TUNER */ | ||
255 | else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) | ||
256 | { | ||
257 | presets_draw_markers(display, pb->x, y, pb->width, height); | ||
258 | } | ||
259 | #endif | ||
260 | } | ||
270 | } | 261 | } |
271 | 262 | ||
272 | /* clears the area where the image was shown */ | 263 | /* 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) | |||
783 | } | 774 | } |
784 | return button; | 775 | return button; |
785 | } | 776 | } |
786 | |||
787 | |||
788 | |||