scrollbar.c: Simplify code a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24694 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d50c78c238
commit
13035a48af
2 changed files with 17 additions and 24 deletions
|
@ -194,33 +194,26 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x,
|
|||
screen->set_drawmode(DRMODE_SOLID);
|
||||
|
||||
if (flags & HORIZONTAL) {
|
||||
#if LCD_DEPTH > 1
|
||||
if (bm.format == FORMAT_MONO)
|
||||
#endif
|
||||
screen->mono_bitmap_part(bm.data, 0, 0,
|
||||
bm.width, x + start, y, size, height);
|
||||
#if LCD_DEPTH > 1
|
||||
else
|
||||
screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0,
|
||||
STRIDE(screen->screen_type,
|
||||
bm.width, bm.height),
|
||||
x + start, y, size, height);
|
||||
#endif
|
||||
x += start;
|
||||
width = size;
|
||||
} else {
|
||||
y += start;
|
||||
height = size;
|
||||
}
|
||||
|
||||
#if LCD_DEPTH > 1
|
||||
if (bm.format == FORMAT_MONO)
|
||||
#endif
|
||||
screen->mono_bitmap_part(bm.data, 0, 0,
|
||||
bm.width, x, y + start, width, size);
|
||||
bm.width, x, y, width, height);
|
||||
#if LCD_DEPTH > 1
|
||||
else
|
||||
screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0,
|
||||
STRIDE(screen->screen_type,
|
||||
bm.width, bm.height),
|
||||
x, y + start, width, size);
|
||||
x, y, width, height);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void show_busy_slider(struct screen *s, int x, int y, int width, int height)
|
||||
{
|
||||
|
@ -229,16 +222,14 @@ void show_busy_slider(struct screen *s, int x, int y, int width, int height)
|
|||
start, start+20, HORIZONTAL);
|
||||
#if NB_SCREENS > 1
|
||||
if (s->screen_type == SCREEN_MAIN)
|
||||
{
|
||||
#endif
|
||||
{
|
||||
start += (dir*2);
|
||||
if (start > 79)
|
||||
dir = -1;
|
||||
else if (start < 1)
|
||||
dir = 1;
|
||||
#if NB_SCREENS > 1
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
|
|
@ -53,10 +53,12 @@ extern void gui_scrollbar_draw(struct screen * screen, int x, int y,
|
|||
int width, int height, int items,
|
||||
int min_shown, int max_shown,
|
||||
unsigned flags);
|
||||
extern void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, int y,
|
||||
extern void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm,
|
||||
int x, int y,
|
||||
int width, int height, int items,
|
||||
int min_shown, int max_shown,
|
||||
unsigned flags);
|
||||
extern void show_busy_slider(struct screen *s, int x, int y, int width, int height);
|
||||
extern void show_busy_slider(struct screen *s, int x, int y,
|
||||
int width, int height);
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
#endif /* _GUI_SCROLLBAR_H_ */
|
||||
|
|
Loading…
Reference in a new issue