forked from len0rd/rockbox
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,32 +194,25 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x,
|
||||||
screen->set_drawmode(DRMODE_SOLID);
|
screen->set_drawmode(DRMODE_SOLID);
|
||||||
|
|
||||||
if (flags & HORIZONTAL) {
|
if (flags & HORIZONTAL) {
|
||||||
#if LCD_DEPTH > 1
|
x += start;
|
||||||
if (bm.format == FORMAT_MONO)
|
width = size;
|
||||||
#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
|
|
||||||
} else {
|
} else {
|
||||||
|
y += start;
|
||||||
|
height = size;
|
||||||
|
}
|
||||||
|
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
if (bm.format == FORMAT_MONO)
|
if (bm.format == FORMAT_MONO)
|
||||||
#endif
|
#endif
|
||||||
screen->mono_bitmap_part(bm.data, 0, 0,
|
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
|
#if LCD_DEPTH > 1
|
||||||
else
|
else
|
||||||
screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0,
|
screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0,
|
||||||
STRIDE(screen->screen_type,
|
STRIDE(screen->screen_type,
|
||||||
bm.width, bm.height),
|
bm.width, bm.height),
|
||||||
x, y + start, width, size);
|
x, y, width, height);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_busy_slider(struct screen *s, int x, int y, int width, int height)
|
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);
|
start, start+20, HORIZONTAL);
|
||||||
#if NB_SCREENS > 1
|
#if NB_SCREENS > 1
|
||||||
if (s->screen_type == SCREEN_MAIN)
|
if (s->screen_type == SCREEN_MAIN)
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
start += (dir*2);
|
start += (dir*2);
|
||||||
if (start > 79)
|
if (start > 79)
|
||||||
dir = -1;
|
dir = -1;
|
||||||
else if (start < 1)
|
else if (start < 1)
|
||||||
dir = 1;
|
dir = 1;
|
||||||
#if NB_SCREENS > 1
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
#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 width, int height, int items,
|
||||||
int min_shown, int max_shown,
|
int min_shown, int max_shown,
|
||||||
unsigned flags);
|
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 width, int height, int items,
|
||||||
int min_shown, int max_shown,
|
int min_shown, int max_shown,
|
||||||
unsigned flags);
|
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 /* HAVE_LCD_BITMAP */
|
||||||
#endif /* _GUI_SCROLLBAR_H_ */
|
#endif /* _GUI_SCROLLBAR_H_ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue