forked from len0rd/rockbox
Don't actually reimplement an existing feature for hiding the selection marker
during scrolling. However, the existing one is part of the list api, so it shouldn't be overridden blindly internally, so do the decision in a different but equivalent way. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28147 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e5d43300af
commit
f060cd5428
3 changed files with 14 additions and 16 deletions
|
|
@ -47,6 +47,14 @@
|
||||||
/* these are static to make scrolling work */
|
/* these are static to make scrolling work */
|
||||||
static struct viewport list_text[NB_SCREENS], title_text[NB_SCREENS];
|
static struct viewport list_text[NB_SCREENS], title_text[NB_SCREENS];
|
||||||
|
|
||||||
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
|
static enum {
|
||||||
|
SCROLL_NONE, /* no scrolling */
|
||||||
|
SCROLL_BAR, /* scroll by using the scrollbar */
|
||||||
|
SCROLL_SWIPE, /* scroll by wiping over the screen */
|
||||||
|
} scroll_mode;
|
||||||
|
#endif
|
||||||
|
|
||||||
int gui_list_get_item_offset(struct gui_synclist * gui_list, int item_width,
|
int gui_list_get_item_offset(struct gui_synclist * gui_list, int item_width,
|
||||||
int text_pos, struct screen * display,
|
int text_pos, struct screen * display,
|
||||||
struct viewport *vp);
|
struct viewport *vp);
|
||||||
|
|
@ -232,7 +240,12 @@ void list_draw(struct screen *display, struct gui_synclist *list)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* draw the selected line */
|
/* draw the selected line */
|
||||||
if(!list->hide_selection && i >= list->selected_item
|
if(
|
||||||
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
|
/* don't draw it during scrolling */
|
||||||
|
scroll_mode == SCROLL_NONE &&
|
||||||
|
#endif
|
||||||
|
i >= list->selected_item
|
||||||
&& i < list->selected_item + list->selected_size
|
&& i < list->selected_item + list->selected_size
|
||||||
&& list->show_selection_marker)
|
&& list->show_selection_marker)
|
||||||
{/* The selected item must be displayed scrolling */
|
{/* The selected item must be displayed scrolling */
|
||||||
|
|
@ -311,11 +324,6 @@ void list_draw(struct screen *display, struct gui_synclist *list)
|
||||||
|
|
||||||
#if defined(HAVE_TOUCHSCREEN)
|
#if defined(HAVE_TOUCHSCREEN)
|
||||||
/* This needs to be fixed if we ever get more than 1 touchscreen on a target. */
|
/* This needs to be fixed if we ever get more than 1 touchscreen on a target. */
|
||||||
static enum {
|
|
||||||
SCROLL_NONE, /* no scrolling */
|
|
||||||
SCROLL_BAR, /* scroll by using the scrollbar */
|
|
||||||
SCROLL_SWIPE, /* scroll by wiping over the screen */
|
|
||||||
} scroll_mode;
|
|
||||||
|
|
||||||
static bool released = false;
|
static bool released = false;
|
||||||
|
|
||||||
|
|
@ -390,9 +398,6 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list)
|
||||||
int line, list_width = list_text_vp->width;
|
int line, list_width = list_text_vp->width;
|
||||||
|
|
||||||
released = (button&BUTTON_REL) != 0;
|
released = (button&BUTTON_REL) != 0;
|
||||||
gui_list->hide_selection = (scroll_mode != SCROLL_NONE);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (global_settings.scrollbar == SCROLLBAR_RIGHT)
|
if (global_settings.scrollbar == SCROLLBAR_RIGHT)
|
||||||
list_width += SCROLLBAR_WIDTH;
|
list_width += SCROLLBAR_WIDTH;
|
||||||
|
|
@ -511,8 +516,6 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list)
|
||||||
{
|
{
|
||||||
scroll_mode = SCROLL_NONE;
|
scroll_mode = SCROLL_NONE;
|
||||||
redraw = true;
|
redraw = true;
|
||||||
/* don't draw the selection during scrolling */
|
|
||||||
gui_list->hide_selection = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* select current item */
|
/* select current item */
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,6 @@ void gui_synclist_init(struct gui_synclist * gui_list,
|
||||||
gui_list->callback_speak_item = NULL;
|
gui_list->callback_speak_item = NULL;
|
||||||
gui_list->nb_items = 0;
|
gui_list->nb_items = 0;
|
||||||
gui_list->selected_item = 0;
|
gui_list->selected_item = 0;
|
||||||
gui_list->hide_selection = false;
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
gui_list->start_item[i] = 0;
|
gui_list->start_item[i] = 0;
|
||||||
|
|
|
||||||
|
|
@ -94,10 +94,6 @@ struct gui_synclist
|
||||||
/* wether the text of the whole items of the list have to be
|
/* wether the text of the whole items of the list have to be
|
||||||
* scrolled or only for the selected item */
|
* scrolled or only for the selected item */
|
||||||
bool scroll_all;
|
bool scroll_all;
|
||||||
/*
|
|
||||||
* if true the selection bar will not be drawn
|
|
||||||
*/
|
|
||||||
bool hide_selection;
|
|
||||||
int nb_items;
|
int nb_items;
|
||||||
int selected_item;
|
int selected_item;
|
||||||
int start_item[NB_SCREENS]; /* the item that is displayed at the top of the screen */
|
int start_item[NB_SCREENS]; /* the item that is displayed at the top of the screen */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue