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 317c55c..8f431a4 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,
int infill;
#endif
+ if (flags & INVERTFILL)
+ {
+ min_shown = items - max_shown;
+ max_shown = items;
+ }
+
inner_x = x + 1;
inner_y = y + 1;
inner_wd = width - 2;
@@ -178,11 +184,18 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
int start;
int size;
int inner_len;
+ int startx = 0, starty = 0;
screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
/* clear pixels in progress bar */
screen->fillrect(x, y, width, height);
+
+ if (flags & INVERTFILL)
+ {
+ min_shown = items - max_shown;
+ max_shown = items;
+ }
if (flags & HORIZONTAL)
inner_len = width;
@@ -196,19 +209,23 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
if (flags & HORIZONTAL) {
x += start;
width = size;
+ if (flags & INVERTFILL)
+ startx = start;
} else {
y += start;
height = size;
+ if (flags & INVERTFILL)
+ starty = start;
}
#if LCD_DEPTH > 1
if (bm->format == FORMAT_MONO)
#endif
- screen->mono_bitmap_part(bm->data, 0, 0,
+ screen->mono_bitmap_part(bm->data, startx, starty,
bm->width, x, y, width, height);
#if LCD_DEPTH > 1
else
- screen->transparent_bitmap_part((fb_data *)bm->data, 0, 0,
+ screen->transparent_bitmap_part((fb_data *)bm->data, startx, starty,
STRIDE(screen->screen_type,
bm->width, bm->height),
x, y, width, height);