summaryrefslogtreecommitdiff
path: root/apps/gui/scrollbar.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/scrollbar.c')
-rw-r--r--apps/gui/scrollbar.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c
index 317c55cdc7..8f431a4ff8 100644
--- a/apps/gui/scrollbar.c
+++ b/apps/gui/scrollbar.c
@@ -88,6 +88,12 @@ void gui_scrollbar_draw(struct screen * screen, int x, int y,
88 int infill; 88 int infill;
89#endif 89#endif
90 90
91 if (flags & INVERTFILL)
92 {
93 min_shown = items - max_shown;
94 max_shown = items;
95 }
96
91 inner_x = x + 1; 97 inner_x = x + 1;
92 inner_y = y + 1; 98 inner_y = y + 1;
93 inner_wd = width - 2; 99 inner_wd = width - 2;
@@ -178,11 +184,18 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
178 int start; 184 int start;
179 int size; 185 int size;
180 int inner_len; 186 int inner_len;
187 int startx = 0, starty = 0;
181 188
182 screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 189 screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
183 190
184 /* clear pixels in progress bar */ 191 /* clear pixels in progress bar */
185 screen->fillrect(x, y, width, height); 192 screen->fillrect(x, y, width, height);
193
194 if (flags & INVERTFILL)
195 {
196 min_shown = items - max_shown;
197 max_shown = items;
198 }
186 199
187 if (flags & HORIZONTAL) 200 if (flags & HORIZONTAL)
188 inner_len = width; 201 inner_len = width;
@@ -196,19 +209,23 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
196 if (flags & HORIZONTAL) { 209 if (flags & HORIZONTAL) {
197 x += start; 210 x += start;
198 width = size; 211 width = size;
212 if (flags & INVERTFILL)
213 startx = start;
199 } else { 214 } else {
200 y += start; 215 y += start;
201 height = size; 216 height = size;
217 if (flags & INVERTFILL)
218 starty = start;
202 } 219 }
203 220
204#if LCD_DEPTH > 1 221#if LCD_DEPTH > 1
205 if (bm->format == FORMAT_MONO) 222 if (bm->format == FORMAT_MONO)
206#endif 223#endif
207 screen->mono_bitmap_part(bm->data, 0, 0, 224 screen->mono_bitmap_part(bm->data, startx, starty,
208 bm->width, x, y, width, height); 225 bm->width, x, y, width, height);
209#if LCD_DEPTH > 1 226#if LCD_DEPTH > 1
210 else 227 else
211 screen->transparent_bitmap_part((fb_data *)bm->data, 0, 0, 228 screen->transparent_bitmap_part((fb_data *)bm->data, startx, starty,
212 STRIDE(screen->screen_type, 229 STRIDE(screen->screen_type,
213 bm->width, bm->height), 230 bm->width, bm->height),
214 x, y, width, height); 231 x, y, width, height);