diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/list.c | 40 | ||||
-rw-r--r-- | apps/lang/english.lang | 6 | ||||
-rw-r--r-- | apps/settings.c | 39 | ||||
-rw-r--r-- | apps/settings.h | 1 | ||||
-rw-r--r-- | apps/settings_menu.c | 9 |
5 files changed, 69 insertions, 26 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index ce2a3354e4..743e603a02 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -295,11 +295,21 @@ void gui_list_select_next(struct gui_list * gui_list) | |||
295 | gui_list->selected_item++; | 295 | gui_list->selected_item++; |
296 | item_pos = gui_list->selected_item - gui_list->start_item; | 296 | item_pos = gui_list->selected_item - gui_list->start_item; |
297 | end_item = gui_list->start_item + nb_lines; | 297 | end_item = gui_list->start_item + nb_lines; |
298 | /* we start scrolling vertically when reaching the line | 298 | if (global_settings.scroll_paginated) |
299 | * (nb_lines-SCROLL_LIMIT) | 299 | { |
300 | * and when we are not in the last part of the list*/ | 300 | /* When we reach the bottom of the list |
301 | if( item_pos > nb_lines-SCROLL_LIMIT && end_item < gui_list->nb_items ) | 301 | * we jump to a new page if there are more items*/ |
302 | gui_list->start_item++; | 302 | if( item_pos > nb_lines-1 && end_item < gui_list->nb_items ) |
303 | gui_list->start_item = gui_list->selected_item; | ||
304 | } | ||
305 | else | ||
306 | { | ||
307 | /* we start scrolling vertically when reaching the line | ||
308 | * (nb_lines-SCROLL_LIMIT) | ||
309 | * and when we are not in the last part of the list*/ | ||
310 | if( item_pos > nb_lines-SCROLL_LIMIT && end_item < gui_list->nb_items ) | ||
311 | gui_list->start_item++; | ||
312 | } | ||
303 | } | 313 | } |
304 | } | 314 | } |
305 | 315 | ||
@@ -323,10 +333,26 @@ void gui_list_select_previous(struct gui_list * gui_list) | |||
323 | else | 333 | else |
324 | { | 334 | { |
325 | int item_pos; | 335 | int item_pos; |
336 | int nb_lines = gui_list->display->nb_lines; | ||
326 | gui_list->selected_item--; | 337 | gui_list->selected_item--; |
327 | item_pos = gui_list->selected_item - gui_list->start_item; | 338 | item_pos = gui_list->selected_item - gui_list->start_item; |
328 | if( item_pos < SCROLL_LIMIT-1 && gui_list->start_item > 0 ) | 339 | if (global_settings.scroll_paginated) |
329 | gui_list->start_item--; | 340 | { |
341 | /* When we reach the top of the list | ||
342 | * we jump to a new page if there are more items*/ | ||
343 | if( item_pos < 0 && gui_list->start_item > 0 ) | ||
344 | gui_list->start_item = gui_list->selected_item-nb_lines+1; | ||
345 | if( gui_list->start_item < 0 ) | ||
346 | gui_list->start_item = 0; | ||
347 | } | ||
348 | else | ||
349 | { | ||
350 | /* we start scrolling vertically when reaching the line | ||
351 | * (nb_lines-SCROLL_LIMIT) | ||
352 | * and when we are not in the last part of the list*/ | ||
353 | if( item_pos < SCROLL_LIMIT-1 && gui_list->start_item > 0 ) | ||
354 | gui_list->start_item--; | ||
355 | } | ||
330 | } | 356 | } |
331 | } | 357 | } |
332 | 358 | ||
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 1e03bf4d2d..a5b3f916c1 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -3718,3 +3718,9 @@ desc: in the recording screen | |||
3718 | eng: "D" | 3718 | eng: "D" |
3719 | voice: "Digital Gain" | 3719 | voice: "Digital Gain" |
3720 | new: | 3720 | new: |
3721 | |||
3722 | id: LANG_SCROLL_PAGINATED | ||
3723 | desc: jump to new page when scrolling | ||
3724 | eng: "Paged Scrolling" | ||
3725 | voice: "" | ||
3726 | new: | ||
diff --git a/apps/settings.c b/apps/settings.c index 2f782f46de..0c62fd2201 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -512,25 +512,25 @@ static const struct bit_entry hd_bits[] = | |||
512 | {1, S_O(warnon_erase_dynplaylist), false, | 512 | {1, S_O(warnon_erase_dynplaylist), false, |
513 | "warn when erasing dynamic playlist", off_on }, | 513 | "warn when erasing dynamic playlist", off_on }, |
514 | #if CONFIG_CODEC == SWCODEC | 514 | #if CONFIG_CODEC == SWCODEC |
515 | {1, S_O(eq_enabled), false, "eq enabled", off_on }, | 515 | {1, S_O(eq_enabled), false, "eq enabled", off_on }, |
516 | /* 0..32768 Hz */ | 516 | /* 0..32768 Hz */ |
517 | {15, S_O(eq_band0_cutoff), 60, "eq band 0 cutoff", NULL }, | 517 | {15, S_O(eq_band0_cutoff), 60, "eq band 0 cutoff", NULL }, |
518 | {15, S_O(eq_band1_cutoff), 200, "eq band 1 cutoff", NULL }, | 518 | {15, S_O(eq_band1_cutoff), 200, "eq band 1 cutoff", NULL }, |
519 | {15, S_O(eq_band2_cutoff), 800, "eq band 2 cutoff", NULL }, | 519 | {15, S_O(eq_band2_cutoff), 800, "eq band 2 cutoff", NULL }, |
520 | {15, S_O(eq_band3_cutoff), 4000, "eq band 3 cutoff", NULL }, | 520 | {15, S_O(eq_band3_cutoff), 4000, "eq band 3 cutoff", NULL }, |
521 | {15, S_O(eq_band4_cutoff), 12000, "eq band 4 cutoff", NULL }, | 521 | {15, S_O(eq_band4_cutoff), 12000, "eq band 4 cutoff", NULL }, |
522 | /* 0..64 (or 0.0 to 6.4) */ | 522 | /* 0..64 (or 0.0 to 6.4) */ |
523 | {6, S_O(eq_band0_q), 7, "eq band 0 q", NULL }, | 523 | {6, S_O(eq_band0_q), 7, "eq band 0 q", NULL }, |
524 | {6, S_O(eq_band1_q), 10, "eq band 1 q", NULL }, | 524 | {6, S_O(eq_band1_q), 10, "eq band 1 q", NULL }, |
525 | {6, S_O(eq_band2_q), 10, "eq band 2 q", NULL }, | 525 | {6, S_O(eq_band2_q), 10, "eq band 2 q", NULL }, |
526 | {6, S_O(eq_band3_q), 10, "eq band 3 q", NULL }, | 526 | {6, S_O(eq_band3_q), 10, "eq band 3 q", NULL }, |
527 | {6, S_O(eq_band4_q), 7, "eq band 4 q", NULL }, | 527 | {6, S_O(eq_band4_q), 7, "eq band 4 q", NULL }, |
528 | /* -240..240 (or -24db to +24db) */ | 528 | /* -240..240 (or -24db to +24db) */ |
529 | {9|SIGNED, S_O(eq_band0_gain), 0, "eq band 0 gain", NULL }, | 529 | {9|SIGNED, S_O(eq_band0_gain), 0, "eq band 0 gain", NULL }, |
530 | {9|SIGNED, S_O(eq_band1_gain), 0, "eq band 1 gain", NULL }, | 530 | {9|SIGNED, S_O(eq_band1_gain), 0, "eq band 1 gain", NULL }, |
531 | {9|SIGNED, S_O(eq_band2_gain), 0, "eq band 2 gain", NULL }, | 531 | {9|SIGNED, S_O(eq_band2_gain), 0, "eq band 2 gain", NULL }, |
532 | {9|SIGNED, S_O(eq_band3_gain), 0, "eq band 3 gain", NULL }, | 532 | {9|SIGNED, S_O(eq_band3_gain), 0, "eq band 3 gain", NULL }, |
533 | {9|SIGNED, S_O(eq_band4_gain), 0, "eq band 4 gain", NULL }, | 533 | {9|SIGNED, S_O(eq_band4_gain), 0, "eq band 4 gain", NULL }, |
534 | #endif | 534 | #endif |
535 | #if defined(HAVE_UDA1380) /* PLEASE merge this with the other UDA1380 define | 535 | #if defined(HAVE_UDA1380) /* PLEASE merge this with the other UDA1380 define |
536 | when bumping the settings version number PLEASE */ | 536 | when bumping the settings version number PLEASE */ |
@@ -539,6 +539,7 @@ static const struct bit_entry hd_bits[] = | |||
539 | {8|SIGNED, S_O(rec_mic_decimator_right_gain), 0, /* 0dB */ | 539 | {8|SIGNED, S_O(rec_mic_decimator_right_gain), 0, /* 0dB */ |
540 | "mic decimator right gain", NULL }, /* -128...48 */ | 540 | "mic decimator right gain", NULL }, /* -128...48 */ |
541 | #endif | 541 | #endif |
542 | {1, S_O(scroll_paginated), false, "scroll paginated", off_on }, | ||
542 | /* If values are just added to the end, no need to bump the version. */ | 543 | /* If values are just added to the end, no need to bump the version. */ |
543 | /* new stuff to be added at the end */ | 544 | /* new stuff to be added at the end */ |
544 | 545 | ||
diff --git a/apps/settings.h b/apps/settings.h index e2bd4c1af0..9548936349 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -451,6 +451,7 @@ struct user_settings | |||
451 | #endif | 451 | #endif |
452 | 452 | ||
453 | bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */ | 453 | bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */ |
454 | bool scroll_paginated; /* 0=dont 1=do */ | ||
454 | }; | 455 | }; |
455 | 456 | ||
456 | enum optiontype { INT, BOOL }; | 457 | enum optiontype { INT, BOOL }; |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index e70ed6767b..6ac0b6feb2 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -92,6 +92,14 @@ static bool show_icons(void) | |||
92 | return set_bool( (char *)str(LANG_SHOW_ICONS), &global_settings.show_icons ); | 92 | return set_bool( (char *)str(LANG_SHOW_ICONS), &global_settings.show_icons ); |
93 | } | 93 | } |
94 | 94 | ||
95 | /** | ||
96 | * Menu to set the option to scroll paginated | ||
97 | */ | ||
98 | static bool scroll_paginated(void) | ||
99 | { | ||
100 | return set_bool( (char *)str(LANG_SCROLL_PAGINATED), &global_settings.scroll_paginated ); | ||
101 | } | ||
102 | |||
95 | #ifdef HAVE_REMOTE_LCD | 103 | #ifdef HAVE_REMOTE_LCD |
96 | static bool remote_contrast(void) | 104 | static bool remote_contrast(void) |
97 | { | 105 | { |
@@ -1540,6 +1548,7 @@ static bool scroll_settings_menu(void) | |||
1540 | { ID2P(LANG_SCREEN_SCROLL_VIEW), screen_scroll }, | 1548 | { ID2P(LANG_SCREEN_SCROLL_VIEW), screen_scroll }, |
1541 | { ID2P(LANG_SCREEN_SCROLL_STEP), screen_scroll_step }, | 1549 | { ID2P(LANG_SCREEN_SCROLL_STEP), screen_scroll_step }, |
1542 | #endif | 1550 | #endif |
1551 | { ID2P(LANG_SCROLL_PAGINATED), scroll_paginated }, | ||
1543 | }; | 1552 | }; |
1544 | 1553 | ||
1545 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1554 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |