Address FS#6310 - shows an "infinite" slider when deleting/copying/moving files.
maybe add this to other parts of the code so it doesnt look like the ui has stalled git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14189 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
97c4694bc2
commit
8d4d5f67ea
3 changed files with 43 additions and 1 deletions
|
@ -241,4 +241,24 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x,
|
|||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void show_busy_slider(struct screen *s, int x, int y, int width, int height)
|
||||
{
|
||||
static int start = 0, dir = 1;
|
||||
gui_scrollbar_draw(s, x, y, width, height, 100,
|
||||
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 */
|
||||
|
|
|
@ -55,5 +55,6 @@ extern void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm,
|
|||
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);
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
#endif /* _GUI_SCROLLBAR_H_ */
|
||||
|
|
|
@ -487,8 +487,13 @@ static int remove_dir(char* dirname, int len)
|
|||
}
|
||||
else
|
||||
{ /* remove a file */
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].puts_scroll(0,2,entry->d_name);
|
||||
{
|
||||
show_busy_slider(&screens[i], 2, 3*screens[i].char_height,
|
||||
LCD_WIDTH-4, screens[i].char_height);
|
||||
}
|
||||
#endif
|
||||
result = remove(dirname);
|
||||
}
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
@ -661,6 +666,21 @@ static bool clipboard_copy(void)
|
|||
return clipboard_clip(true);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
static inline void draw_slider(void)
|
||||
{
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
show_busy_slider(&screens[i], 2, LCD_HEIGHT/4,
|
||||
LCD_WIDTH-4, screens[i].char_height);
|
||||
screens[i].update();
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define draw_slider()
|
||||
#endif
|
||||
|
||||
/* Paste a file to a new directory. Will overwrite always. */
|
||||
static bool clipboard_pastefile(const char *src, const char *target, bool copy)
|
||||
{
|
||||
|
@ -721,6 +741,7 @@ static bool clipboard_pastefile(const char *src, const char *target, bool copy)
|
|||
}
|
||||
|
||||
bytesread -= byteswritten;
|
||||
draw_slider();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue