summaryrefslogtreecommitdiff
path: root/apps/gui/list.h
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2019-11-02 06:15:01 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2020-11-14 00:01:39 +0000
commit43f90746d5610a36eaf7dc98b9fa3ca17ee6010e (patch)
treece47b270bfbfe184bf1f94b7097ac30a7478563e /apps/gui/list.h
parent610ad6f6e34282333114cc83d4c65300da71a40c (diff)
downloadrockbox-43f90746d5610a36eaf7dc98b9fa3ca17ee6010e.tar.gz
rockbox-43f90746d5610a36eaf7dc98b9fa3ca17ee6010e.zip
synclist add method for setting selection color
Change-Id: I8c8761d92f4fc99f65d45098ee6e97800d3fe002
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r--apps/gui/list.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h
index f860e27bf9..3a613d0a67 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -26,6 +26,7 @@
26#include "icon.h" 26#include "icon.h"
27#include "screen_access.h" 27#include "screen_access.h"
28#include "skin_engine/skin_engine.h" 28#include "skin_engine/skin_engine.h"
29#include "line.h"
29 30
30#define SCROLLBAR_WIDTH global_settings.scrollbar_width 31#define SCROLLBAR_WIDTH global_settings.scrollbar_width
31 32
@@ -85,6 +86,26 @@ typedef int list_speak_item(int selected_item, void * data);
85 * selected item, negative value for default coloring. 86 * selected item, negative value for default coloring.
86 */ 87 */
87typedef int list_get_color(int selected_item, void * data); 88typedef int list_get_color(int selected_item, void * data);
89
90struct list_selection_color
91{
92 /* text color, in native lcd format
93 * (convert with LCD_RGBPACK() if necessary) */
94 unsigned text_color;
95 /* only STYLE_GRADIENT supported set line_color & line_end_color the same
96 * for solid color, in native
97 * lcd format (convert with LCD_RGBPACK() if necessary) */
98 unsigned line_color;
99 unsigned line_end_color;
100 /* viewport foreground and background, in native
101 * lcd format (convert with LCD_RGBPACK() if necessary) */
102 unsigned fg_color;
103 unsigned bg_color;
104 /* To enable:
105 * call gui_synclist_set_sel_color(gui_synclist*, list_selection_color*)
106 * If using the default viewport you should call
107 * gui_synclist_set_sel_color(gui_synclist*, NULL) when finished */
108};
88#endif 109#endif
89 110
90struct gui_synclist 111struct gui_synclist
@@ -120,6 +141,7 @@ struct gui_synclist
120#ifdef HAVE_LCD_COLOR 141#ifdef HAVE_LCD_COLOR
121 int title_color; 142 int title_color;
122 list_get_color *callback_get_item_color; 143 list_get_color *callback_get_item_color;
144 struct list_selection_color *selection_color;
123#endif 145#endif
124 struct viewport *parent[NB_SCREENS]; 146 struct viewport *parent[NB_SCREENS];
125}; 147};
@@ -146,6 +168,7 @@ extern void gui_synclist_set_voice_callback(struct gui_synclist * lists, list_sp
146extern void gui_synclist_set_viewport_defaults(struct viewport *vp, enum screen_type screen); 168extern void gui_synclist_set_viewport_defaults(struct viewport *vp, enum screen_type screen);
147#ifdef HAVE_LCD_COLOR 169#ifdef HAVE_LCD_COLOR
148extern void gui_synclist_set_color_callback(struct gui_synclist * lists, list_get_color color_callback); 170extern void gui_synclist_set_color_callback(struct gui_synclist * lists, list_get_color color_callback);
171extern void gui_synclist_set_sel_color(struct gui_synclist * lists, struct list_selection_color *list_sel_color);
149#endif 172#endif
150extern void gui_synclist_speak_item(struct gui_synclist * lists); 173extern void gui_synclist_speak_item(struct gui_synclist * lists);
151extern int gui_synclist_get_nb_items(struct gui_synclist * lists); 174extern int gui_synclist_get_nb_items(struct gui_synclist * lists);
@@ -232,6 +255,8 @@ struct simplelist_info {
232 int selection_size; /* list selection size, usually 1 */ 255 int selection_size; /* list selection size, usually 1 */
233 bool hide_selection; 256 bool hide_selection;
234 bool scroll_all; 257 bool scroll_all;
258 bool hide_theme;
259 bool speak_onshow; /* list speaks first item or 'empty list' */
235 int timeout; 260 int timeout;
236 int selection; /* the item to select when the list is first displayed */ 261 int selection; /* the item to select when the list is first displayed */
237 /* when the list is exited, this will be set to the 262 /* when the list is exited, this will be set to the
@@ -248,6 +273,7 @@ struct simplelist_info {
248 list_speak_item *get_talk; /* can be NULL to not speak */ 273 list_speak_item *get_talk; /* can be NULL to not speak */
249#ifdef HAVE_LCD_COLOR 274#ifdef HAVE_LCD_COLOR
250 list_get_color *get_color; 275 list_get_color *get_color;
276 struct list_selection_color *selection_color;
251#endif 277#endif
252 void *callback_data; /* data for callbacks */ 278 void *callback_data; /* data for callbacks */
253}; 279};
@@ -275,12 +301,15 @@ void simplelist_addline(const char *fmt, ...);
275 info.selection_size = 1; 301 info.selection_size = 1;
276 info.hide_selection = false; 302 info.hide_selection = false;
277 info.scroll_all = false; 303 info.scroll_all = false;
304 info.hide_theme = false;
305 info.speak_onshow = true;
278 info.action_callback = NULL; 306 info.action_callback = NULL;
279 info.title_icon = Icon_NOICON; 307 info.title_icon = Icon_NOICON;
280 info.get_icon = NULL; 308 info.get_icon = NULL;
281 info.get_name = NULL; 309 info.get_name = NULL;
282 info.get_voice = NULL; 310 info.get_voice = NULL;
283 info.get_color = NULL; 311 info.get_color = NULL;
312 info.list_selection_color = NULL;
284 info.timeout = HZ/10; 313 info.timeout = HZ/10;
285 info.selection = 0; 314 info.selection = 0;
286*/ 315*/