touchscreen: Port list code to gesture API

Make use of the new gesture API to overhaul list touch support.
This should fix most of the annoyances with touch navigation in
menus and make the touchscreen easier to use.

Change-Id: Ied300947fcf755e2810e9348496ed86eaf620669
This commit is contained in:
Aidan MacDonald 2022-04-23 19:04:29 +01:00 committed by Solomon Peachy
parent e2363b0e2c
commit 67233114f7
3 changed files with 242 additions and 374 deletions

View file

@ -23,6 +23,7 @@
#define _GUI_LIST_H_
#include "config.h"
#include "action.h"
#include "icon.h"
#include "screen_access.h"
#include "skin_engine/skin_engine.h"
@ -155,10 +156,6 @@ struct gui_synclist
int nb_items;
int selected_item;
#ifdef HAVE_TOUCHSCREEN
/* absolute Y coordinate, used for smooth scrolling */
int y_pos;
#endif
int start_item[NB_SCREENS]; /* the item that is displayed at the top of the screen */
/* the number of lines that are selected at the same time */
int selected_size;
@ -185,6 +182,12 @@ struct gui_synclist
struct list_selection_color *selection_color;
#endif
struct viewport *parent[NB_SCREENS];
#ifdef HAVE_TOUCHSCREEN
int y_pos; /* absolute Y coordinate, used for smooth scrolling */
int scroll_base_y; /* used for swipe scrolling */
int scroll_mode; /* see apps/gui/bitmap/list.c */
#endif
};