summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Sauro <olsroparadise@proton.me>2024-08-28 17:44:16 +0200
committerWilliam Wilgus <wilgus.william@gmail.com>2024-08-28 20:24:44 -0400
commitf69d9c8a9508871c93396a4261bcc41a8a3cddc7 (patch)
tree8c8968007ea27e847e39edfd1f4459bc255bc3fe
parentf6b9e923dc6b2601e9e6190fd887d5b5277b2b59 (diff)
downloadrockbox-f69d9c8a95.tar.gz
rockbox-f69d9c8a95.zip
Settings: Add a new option to prevent text scrollings in the home screen
This option is especially useful for theme creators that want to create themes with lockscreens. When text is scrolling, it is breaking the lockscreen so setting this option to true prevent this. Text will continue to scroll normally in all other contexts. Change-Id: I194f6837217881d50f567a775b81d0b422caf35c
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/lang/francais.lang14
-rw-r--r--apps/menus/display_menu.c5
-rw-r--r--apps/settings.h1
-rw-r--r--apps/settings_list.c2
-rw-r--r--firmware/drivers/lcd-scroll.c10
6 files changed, 44 insertions, 2 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index c41c819a7b..b0c7aed8f7 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -16498,6 +16498,20 @@
</voice>
</phrase>
<phrase>
+ id: LANG_DISABLE_MAINMENU_SCROLLING
+ desc: Disable main menu scrolling
+ user: core
+ <source>
+ *: "Disable main menu scrolling"
+ </source>
+ <dest>
+ *: "Disable main menu scrolling"
+ </dest>
+ <voice>
+ *: "Disable main menu scrolling"
+ </voice>
+</phrase>
+<phrase>
id: LANG_REMAINING
desc: Playing Time
user: core
diff --git a/apps/lang/francais.lang b/apps/lang/francais.lang
index 55b7ae9f63..ce907372b0 100644
--- a/apps/lang/francais.lang
+++ b/apps/lang/francais.lang
@@ -15080,3 +15080,17 @@
*: "Français"
</voice>
</phrase>
+<phrase>
+ id: LANG_DISABLE_MAINMENU_SCROLLING
+ desc: Disable main menu scrolling
+ user: core
+ <source>
+ *: "Disable main menu scrolling"
+ </source>
+ <dest>
+ *: "Désactiver défilement dans le menu principal"
+ </dest>
+ <voice>
+ *: "Désactiver défilement dans le menu principal"
+ </voice>
+</phrase>
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index c5c5e6d908..2ce566a888 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -331,6 +331,7 @@ MENUITEM_SETTING(list_accel_start_delay,
MENUITEM_SETTING(list_accel_wait, &global_settings.list_accel_wait, NULL);
#endif /* HAVE_WHEEL_ACCELERATION */
MENUITEM_SETTING(offset_out_of_view, &global_settings.offset_out_of_view, NULL);
+MENUITEM_SETTING(disable_mainmenu_scrolling, &global_settings.disable_mainmenu_scrolling, NULL);
MENUITEM_SETTING(screen_scroll_step, &global_settings.screen_scroll_step, NULL);
MENUITEM_SETTING(scroll_paginated, &global_settings.scroll_paginated, NULL);
MENUITEM_SETTING(list_wraparound, &global_settings.list_wraparound, NULL);
@@ -343,7 +344,9 @@ MAKE_MENU(scroll_settings_menu, ID2P(LANG_SCROLL_MENU), 0, Icon_NOICON,
#ifdef HAVE_REMOTE_LCD
&remote_scroll_sets,
#endif
- &offset_out_of_view, &screen_scroll_step,
+ &offset_out_of_view,
+ &disable_mainmenu_scrolling,
+ &screen_scroll_step,
&scroll_paginated,
&list_wraparound,
&list_order,
diff --git a/apps/settings.h b/apps/settings.h
index 056f40df6a..1343538b0b 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -686,6 +686,7 @@ struct user_settings
int screen_scroll_step;
int show_path_in_browser; /* 0=off, 1=current directory, 2=full path */
bool offset_out_of_view;
+ bool disable_mainmenu_scrolling;
unsigned char icon_file[MAX_FILENAME+1];
unsigned char viewers_icon_file[MAX_FILENAME+1];
unsigned char font_file[MAX_FILENAME+1]; /* last font */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 98e8dec5a8..8ec434bd9b 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -1319,6 +1319,8 @@ const struct settings_list settings[] = {
#endif
OFFON_SETTING(0, offset_out_of_view, LANG_SCREEN_SCROLL_VIEW,
false, "Screen Scrolls Out Of View", NULL),
+ OFFON_SETTING(0, disable_mainmenu_scrolling, LANG_DISABLE_MAINMENU_SCROLLING,
+ false, "Disable main menu scrolling", NULL),
INT_SETTING(F_PADTITLE, scroll_step, LANG_SCROLL_STEP, 6, "scroll step",
UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, lcd_scroll_step),
INT_SETTING(F_PADTITLE, screen_scroll_step, LANG_SCREEN_SCROLL_STEP, 16,
diff --git a/firmware/drivers/lcd-scroll.c b/firmware/drivers/lcd-scroll.c
index 895cf98cba..8ab91ef642 100644
--- a/firmware/drivers/lcd-scroll.c
+++ b/firmware/drivers/lcd-scroll.c
@@ -24,6 +24,8 @@
/* This file is meant to be #included by scroll_engine.c (twice if a remote
* is present) */
+#include "misc.h"
+#include "settings.h"
#ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */
#define LCDFN(fn) lcd_ ## fn
#define LCDM(ma) LCD_ ## ma
@@ -195,8 +197,14 @@ static void LCDFN(scroll_worker)(void)
s = &si->scroll[index];
/* check pause */
- if (TIME_BEFORE(current_tick, s->start_tick))
+ if (TIME_BEFORE(current_tick, s->start_tick)) {
continue;
+ }
+
+ if (global_settings.disable_mainmenu_scrolling && get_current_activity() == ACTIVITY_MAINMENU) {
+ // No scrolling on the main menu if disabled (to not break themes with lockscreens)
+ continue;
+ }
s->start_tick = current_tick;