mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-19 10:02:45 -05:00
Fix some mistakes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17678 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
999d3e89a8
commit
75cac2c604
1 changed files with 8 additions and 8 deletions
|
|
@ -282,7 +282,7 @@ void list_draw(struct screen *display, struct viewport *parent,
|
||||||
* This also assumes the whole screen is used, which is a bad assumption but
|
* This also assumes the whole screen is used, which is a bad assumption but
|
||||||
* fine until customizable lists comes in...
|
* fine until customizable lists comes in...
|
||||||
*/
|
*/
|
||||||
static unsigned int prev_line=0;
|
static bool scrolling=false;
|
||||||
|
|
||||||
unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewport *parent)
|
unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewport *parent)
|
||||||
{
|
{
|
||||||
|
|
@ -335,7 +335,7 @@ unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewpor
|
||||||
* | Pressing an item will select it and "enter" it. |
|
* | Pressing an item will select it and "enter" it. |
|
||||||
* | |
|
* | |
|
||||||
* | Pressing and holding your pen down will scroll through |
|
* | Pressing and holding your pen down will scroll through |
|
||||||
* | the list of items, releasing your pen will "enter" it. |
|
* | the list of items. |
|
||||||
* | |
|
* | |
|
||||||
* | Pressing and holding your pen down on a single item |
|
* | Pressing and holding your pen down on a single item |
|
||||||
* | will bring up the context menu of it. |
|
* | will bring up the context menu of it. |
|
||||||
|
|
@ -360,32 +360,32 @@ unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewpor
|
||||||
if(line == -1)
|
if(line == -1)
|
||||||
return ACTION_NONE;
|
return ACTION_NONE;
|
||||||
|
|
||||||
/* BUTTON_TOUCHPAD represents a button press*/
|
|
||||||
if (line != gui_list->selected_item - gui_list->start_item[SCREEN_MAIN] && button ^ BUTTON_REL)
|
if (line != gui_list->selected_item - gui_list->start_item[SCREEN_MAIN] && button ^ BUTTON_REL)
|
||||||
{
|
{
|
||||||
if (gui_list->start_item[SCREEN_MAIN]+line > gui_list->nb_items)
|
if (gui_list->start_item[SCREEN_MAIN]+line > gui_list->nb_items)
|
||||||
return ACTION_NONE;
|
return ACTION_NONE;
|
||||||
|
if(button & BUTTON_REPEAT)
|
||||||
|
scrolling = true;
|
||||||
gui_synclist_select_item(gui_list, gui_list->start_item[SCREEN_MAIN]+line);
|
gui_synclist_select_item(gui_list, gui_list->start_item[SCREEN_MAIN]+line);
|
||||||
return ACTION_REDRAW;
|
return ACTION_REDRAW;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button == (BUTTON_REPEAT|BUTTON_REL))
|
if (button == (BUTTON_REPEAT|BUTTON_REL))
|
||||||
{
|
{
|
||||||
if(prev_line == (unsigned)line)
|
if(!scrolling)
|
||||||
{
|
{
|
||||||
/* Pen was hold on the same line as the previously selected one
|
/* Pen was hold on the same line as the previously selected one
|
||||||
* => simulate long button press
|
* => simulate long button press
|
||||||
*/
|
*/
|
||||||
prev_line = -1;
|
|
||||||
return ACTION_STD_CONTEXT;
|
return ACTION_STD_CONTEXT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Pen was moved across several lines and then released on this one
|
/* Pen was moved across several lines and then released on this one
|
||||||
* => simulate short button press
|
* => do nothing
|
||||||
*/
|
*/
|
||||||
prev_line = line;
|
scrolling = false;
|
||||||
return ACTION_STD_OK;
|
return ACTION_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(button == BUTTON_REL)
|
else if(button == BUTTON_REL)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue