diff options
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r-- | apps/gui/list.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index a8055c4581..29c80574c2 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -129,6 +129,18 @@ void list_init_item_height(struct gui_synclist *list, enum screen_type screen) | |||
129 | #endif | 129 | #endif |
130 | } | 130 | } |
131 | 131 | ||
132 | void gui_synclist_init_display_settings(struct gui_synclist * list) | ||
133 | { | ||
134 | struct user_settings *gs = &global_settings; | ||
135 | list->scrollbar = gs->scrollbar; | ||
136 | list->show_icons = gs->show_icons; | ||
137 | list->scroll_paginated = gs->scroll_paginated; | ||
138 | list->keyclick = gs->keyclick; | ||
139 | list->talk_menu = gs->talk_menu; | ||
140 | list->wraparound = gs->list_wraparound; | ||
141 | list->cursor_style = gs->cursor_style; | ||
142 | } | ||
143 | |||
132 | /* | 144 | /* |
133 | * Initializes a scrolling list | 145 | * Initializes a scrolling list |
134 | * - gui_list : the list structure to initialize | 146 | * - gui_list : the list structure to initialize |
@@ -153,6 +165,8 @@ void gui_synclist_init(struct gui_synclist * gui_list, | |||
153 | gui_list->callback_draw_item = NULL; | 165 | gui_list->callback_draw_item = NULL; |
154 | gui_list->nb_items = 0; | 166 | gui_list->nb_items = 0; |
155 | gui_list->selected_item = 0; | 167 | gui_list->selected_item = 0; |
168 | gui_synclist_init_display_settings(gui_list); | ||
169 | |||
156 | #ifdef HAVE_TOUCHSCREEN | 170 | #ifdef HAVE_TOUCHSCREEN |
157 | gui_list->y_pos = 0; | 171 | gui_list->y_pos = 0; |
158 | #endif | 172 | #endif |
@@ -263,7 +277,7 @@ static void gui_list_put_selection_on_screen(struct gui_synclist * gui_list, | |||
263 | { | 277 | { |
264 | new_start_item = gui_list->selected_item; | 278 | new_start_item = gui_list->selected_item; |
265 | } | 279 | } |
266 | else if (global_settings.scroll_paginated) | 280 | else if (gui_list->scroll_paginated) |
267 | { | 281 | { |
268 | nb_lines -= nb_lines%gui_list->selected_size; | 282 | nb_lines -= nb_lines%gui_list->selected_size; |
269 | if (difference < 0 || difference >= nb_lines) | 283 | if (difference < 0 || difference >= nb_lines) |
@@ -293,7 +307,7 @@ static void gui_list_put_selection_on_screen(struct gui_synclist * gui_list, | |||
293 | 307 | ||
294 | static void edge_beep(struct gui_synclist * gui_list, bool wrap) | 308 | static void edge_beep(struct gui_synclist * gui_list, bool wrap) |
295 | { | 309 | { |
296 | if (global_settings.keyclick) | 310 | if (gui_list->keyclick) |
297 | { | 311 | { |
298 | list_speak_item *cb = gui_list->callback_speak_item; | 312 | list_speak_item *cb = gui_list->callback_speak_item; |
299 | if (!wrap) /* a bounce */ | 313 | if (!wrap) /* a bounce */ |
@@ -356,7 +370,7 @@ static void _gui_synclist_speak_item(struct gui_synclist *lists) | |||
356 | 370 | ||
357 | void gui_synclist_speak_item(struct gui_synclist *lists) | 371 | void gui_synclist_speak_item(struct gui_synclist *lists) |
358 | { | 372 | { |
359 | if (global_settings.talk_menu) | 373 | if (lists->talk_menu) |
360 | { | 374 | { |
361 | if (lists->nb_items == 0) | 375 | if (lists->nb_items == 0) |
362 | talk_id(VOICE_EMPTY_LIST, true); | 376 | talk_id(VOICE_EMPTY_LIST, true); |
@@ -683,11 +697,10 @@ bool gui_synclist_do_button(struct gui_synclist * lists, | |||
683 | 697 | ||
684 | /* Disable the skin redraw callback */ | 698 | /* Disable the skin redraw callback */ |
685 | current_lists = NULL; | 699 | current_lists = NULL; |
686 | |||
687 | switch (wrap) | 700 | switch (wrap) |
688 | { | 701 | { |
689 | case LIST_WRAP_ON: | 702 | case LIST_WRAP_ON: |
690 | gui_synclist_limit_scroll(lists, !global_settings.list_wraparound); | 703 | gui_synclist_limit_scroll(lists, !(lists->wraparound)); |
691 | break; | 704 | break; |
692 | case LIST_WRAP_OFF: | 705 | case LIST_WRAP_OFF: |
693 | gui_synclist_limit_scroll(lists, true); | 706 | gui_synclist_limit_scroll(lists, true); |
@@ -698,7 +711,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, | |||
698 | action == ACTION_LISTTREE_PGUP || | 711 | action == ACTION_LISTTREE_PGUP || |
699 | action == ACTION_LISTTREE_PGDOWN) | 712 | action == ACTION_LISTTREE_PGDOWN) |
700 | gui_synclist_limit_scroll(lists, true); | 713 | gui_synclist_limit_scroll(lists, true); |
701 | else gui_synclist_limit_scroll(lists, !global_settings.list_wraparound); | 714 | else gui_synclist_limit_scroll(lists, !(lists->wraparound)); |
702 | break; | 715 | break; |
703 | }; | 716 | }; |
704 | 717 | ||