summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/scrollbar.c3
-rw-r--r--apps/gui/scrollbar.h1
-rw-r--r--apps/gui/skin_engine/skin_display.c22
-rw-r--r--apps/gui/skin_engine/skin_parser.c16
-rw-r--r--apps/gui/skin_engine/wps_internals.h1
-rw-r--r--manual/appendix/wps_tags.tex5
6 files changed, 44 insertions, 4 deletions
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c
index 83e86c1527..70d34176e1 100644
--- a/apps/gui/scrollbar.c
+++ b/apps/gui/scrollbar.c
@@ -192,7 +192,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
192 screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 192 screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
193 193
194 /* clear pixels in progress bar */ 194 /* clear pixels in progress bar */
195 screen->fillrect(x, y, width, height); 195 if ((flags&DONT_CLEAR_EXCESS) == 0)
196 screen->fillrect(x, y, width, height);
196 197
197 screen->set_drawmode(DRMODE_SOLID); 198 screen->set_drawmode(DRMODE_SOLID);
198 199
diff --git a/apps/gui/scrollbar.h b/apps/gui/scrollbar.h
index 31f91a3eaa..606b9bd3d3 100644
--- a/apps/gui/scrollbar.h
+++ b/apps/gui/scrollbar.h
@@ -37,6 +37,7 @@ enum orientation {
37 color even if FOREGROUND */ 37 color even if FOREGROUND */
38 INNER_FILL_MASK = 0x00c0, 38 INNER_FILL_MASK = 0x00c0,
39#endif 39#endif
40 DONT_CLEAR_EXCESS = 0x0100, /* Don't clear the entire bar area */
40}; 41};
41 42
42/* 43/*
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index ccedea92a8..5d90e14a0e 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -234,6 +234,28 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
234 y += img->bm.height / 2; 234 y += img->bm.height / 2;
235 } 235 }
236 } 236 }
237
238 if (pb->backdrop)
239 {
240 struct gui_img *img = pb->backdrop;
241#if LCD_DEPTH > 1
242 if(img->bm.format == FORMAT_MONO) {
243#endif
244 display->mono_bitmap_part(img->bm.data,
245 0, 0, img->bm.width,
246 x, y, width, height);
247#if LCD_DEPTH > 1
248 } else {
249 display->transparent_bitmap_part((fb_data *)img->bm.data,
250 0, 0,
251 STRIDE(display->screen_type,
252 img->bm.width, img->bm.height),
253 x, y, width, height);
254 }
255#endif
256 flags |= DONT_CLEAR_EXCESS;
257 }
258
237 if (!pb->nobar) 259 if (!pb->nobar)
238 { 260 {
239 if (pb->image) 261 if (pb->image)
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index e23f84207e..31dd89d0bb 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -601,6 +601,7 @@ static int parse_progressbar_tag(struct skin_element* element,
601 pb->nobar = false; 601 pb->nobar = false;
602 pb->image = NULL; 602 pb->image = NULL;
603 pb->slider = NULL; 603 pb->slider = NULL;
604 pb->backdrop = NULL;
604 pb->invert_fill_direction = false; 605 pb->invert_fill_direction = false;
605 pb->horizontal = true; 606 pb->horizontal = true;
606 607
@@ -696,6 +697,18 @@ static int parse_progressbar_tag(struct skin_element* element,
696 else /* option needs the next param */ 697 else /* option needs the next param */
697 return -1; 698 return -1;
698 } 699 }
700 else if (!strcmp(param->data.text, "backdrop"))
701 {
702 if (curr_param+1 < element->params_count)
703 {
704 curr_param++;
705 param++;
706 pb->backdrop = find_image(param->data.text, wps_data);
707
708 }
709 else /* option needs the next param */
710 return -1;
711 }
699 else if (!strcmp(param->data.text, "vertical")) 712 else if (!strcmp(param->data.text, "vertical"))
700 { 713 {
701 pb->horizontal = false; 714 pb->horizontal = false;
@@ -735,8 +748,7 @@ static int parse_progressbar_tag(struct skin_element* element,
735 add_to_ll_chain(&wps_data->images, item); 748 add_to_ll_chain(&wps_data->images, item);
736 pb->image = img; 749 pb->image = img;
737 } 750 }
738 } 751 }
739
740 752
741 if (token->type == SKIN_TOKEN_VOLUME) 753 if (token->type == SKIN_TOKEN_VOLUME)
742 token->type = SKIN_TOKEN_VOLUMEBAR; 754 token->type = SKIN_TOKEN_VOLUMEBAR;
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 02585f22b2..2bf0ee9fe0 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -111,6 +111,7 @@ struct progressbar {
111 bool nobar; 111 bool nobar;
112 struct gui_img *slider; 112 struct gui_img *slider;
113 bool horizontal; 113 bool horizontal;
114 struct gui_img *backdrop;
114}; 115};
115#endif 116#endif
116 117
diff --git a/manual/appendix/wps_tags.tex b/manual/appendix/wps_tags.tex
index 5028fa81a9..06bae6ce89 100644
--- a/manual/appendix/wps_tags.tex
+++ b/manual/appendix/wps_tags.tex
@@ -663,9 +663,12 @@ display cycling round the defined sublines. See
663 \item[vertical] -- force the bar to be drawn vertically. 663 \item[vertical] -- force the bar to be drawn vertically.
664 \item[invert] -- invert the draw direction (i.e. right to left, or top to 664 \item[invert] -- invert the draw direction (i.e. right to left, or top to
665 bottom). 665 bottom).
666 \item[slider] -- draw an preloaded image over the top of the bar so that 666 \item[slider] -- draw a preloaded image over the top of the bar so that
667 the centre of the image matches the current position. This must be 667 the centre of the image matches the current position. This must be
668 followed by the label of the desired image. 668 followed by the label of the desired image.
669 \item[backdrop] -- draw a preloaded image under the bar. The full
670 image will be displayed and must be the same size as the bar.
671 This must be followed by the label of the desired image.
669 \item[nofill] -- don't draw the bar, only its frame (for use with the 672 \item[nofill] -- don't draw the bar, only its frame (for use with the
670 ``slider'' option). 673 ``slider'' option).
671 \item[nobar] -- don't draw the bar or its frame (for use with the 674 \item[nobar] -- don't draw the bar or its frame (for use with the