diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-04-10 17:15:22 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2022-04-10 22:24:28 -0400 |
commit | ddcab156f7b7675560d4e5bf4fdfab3ca59a6173 (patch) | |
tree | 98ab2634e31d7b26548e5cdbd39eeada9c65b717 /apps/gui/list.h | |
parent | 8dbc0914f6a09bea395f801f948b7a993d379493 (diff) | |
download | rockbox-ddcab156f7b7675560d4e5bf4fdfab3ca59a6173.tar.gz rockbox-ddcab156f7b7675560d4e5bf4fdfab3ca59a6173.zip |
gui_synclist move global display settings to list struct
its really painful needing to override global settings in order to change
some aspects of lists
this patch moves:
[scrollbar position, cursor type,
talk_menus, keyclick,
wrap around, scroll paginated]
to variables within the synclist, it also makes updating
after settings changes a necessity
I think I have the static synclists in core covered
(I think the one in gui/list-skinned can be left as is)
this patch allows easy modification these flags on the fly
Change-Id: Id0dcb8b05eb9ecd78929c0aff7678bf2ab4c70a7
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r-- | apps/gui/list.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h index 1f910577a1..4dc83a1b27 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -36,6 +36,14 @@ enum list_wrap { | |||
36 | LIST_WRAP_UNLESS_HELD, | 36 | LIST_WRAP_UNLESS_HELD, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | enum synclist_cursor | ||
40 | { | ||
41 | SYNCLIST_CURSOR_NOSTYLE = 0, | ||
42 | SYNCLIST_CURSOR_INVERT, | ||
43 | SYNCLIST_CURSOR_COLOR, | ||
44 | SYNCLIST_CURSOR_GRADIENT, | ||
45 | }; | ||
46 | |||
39 | /* | 47 | /* |
40 | * The gui_list is based on callback functions, if you want the list | 48 | * The gui_list is based on callback functions, if you want the list |
41 | * to display something you have to provide it a function that | 49 | * to display something you have to provide it a function that |
@@ -139,14 +147,24 @@ struct list_selection_color | |||
139 | 147 | ||
140 | struct gui_synclist | 148 | struct gui_synclist |
141 | { | 149 | { |
150 | /*flags to hold settings show: icons, scrollbar etc..*/ | ||
151 | int scrollbar; | ||
152 | int cursor_style; | ||
153 | bool show_icons; | ||
154 | bool keyclick; | ||
155 | bool talk_menu; | ||
156 | bool wraparound; | ||
157 | bool scroll_paginated; | ||
142 | /* defines wether the list should stop when reaching the top/bottom | 158 | /* defines wether the list should stop when reaching the top/bottom |
143 | * or should continue (by going to bottom/top) */ | 159 | * or should continue (by going to bottom/top) */ |
144 | bool limit_scroll; | 160 | bool limit_scroll; |
145 | /* wether the text of the whole items of the list have to be | 161 | /* whether the text of the whole items of the list have to be |
146 | * scrolled or only for the selected item */ | 162 | * scrolled or only for the selected item */ |
147 | bool scroll_all; | 163 | bool scroll_all; |
164 | bool show_selection_marker; /* set to true by default */ | ||
148 | int nb_items; | 165 | int nb_items; |
149 | int selected_item; | 166 | int selected_item; |
167 | |||
150 | #ifdef HAVE_TOUCHSCREEN | 168 | #ifdef HAVE_TOUCHSCREEN |
151 | /* absolute Y coordinate, used for smooth scrolling */ | 169 | /* absolute Y coordinate, used for smooth scrolling */ |
152 | int y_pos; | 170 | int y_pos; |
@@ -170,7 +188,6 @@ struct gui_synclist | |||
170 | char * title; | 188 | char * title; |
171 | /* Optional title icon */ | 189 | /* Optional title icon */ |
172 | enum themable_icons title_icon; | 190 | enum themable_icons title_icon; |
173 | bool show_selection_marker; /* set to true by default */ | ||
174 | 191 | ||
175 | #ifdef HAVE_LCD_COLOR | 192 | #ifdef HAVE_LCD_COLOR |
176 | int title_color; | 193 | int title_color; |
@@ -187,7 +204,7 @@ extern void gui_list_screen_scroll_step(int ofs); | |||
187 | 204 | ||
188 | /* parse global setting to static bool */ | 205 | /* parse global setting to static bool */ |
189 | extern void gui_list_screen_scroll_out_of_view(bool enable); | 206 | extern void gui_list_screen_scroll_out_of_view(bool enable); |
190 | 207 | extern void gui_synclist_init_display_settings(struct gui_synclist * list); | |
191 | extern void gui_synclist_init( | 208 | extern void gui_synclist_init( |
192 | struct gui_synclist * lists, | 209 | struct gui_synclist * lists, |
193 | list_get_name callback_get_item_name, | 210 | list_get_name callback_get_item_name, |