summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-05-20 11:34:35 +0000
committerDave Chapman <dave@dchapman.com>2006-05-20 11:34:35 +0000
commit1c9dacd60040b725b95ccf2cd62db3f62b2a8865 (patch)
tree836c0268ac1b21952a3f194ac116b70dccb68438
parentd49b112fd8b903b045f6a723e7065460448cb123 (diff)
downloadrockbox-1c9dacd60040b725b95ccf2cd62db3f62b2a8865.tar.gz
rockbox-1c9dacd60040b725b95ccf2cd62db3f62b2a8865.tar.bz2
rockbox-1c9dacd60040b725b95ccf2cd62db3f62b2a8865.zip
Apply changes to scroll_delay, scroll_speed and scroll_step settings across all screens when changing them in the settings menu. Fixes bug #5348.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9965 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/screen_access.c27
-rw-r--r--apps/screen_access.h9
-rw-r--r--apps/settings_menu.c7
3 files changed, 38 insertions, 5 deletions
diff --git a/apps/screen_access.c b/apps/screen_access.c
index a5dc4ae553..1dc8734462 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -147,8 +147,6 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
screen->drawline=&lcd_drawline;
screen->vline=&lcd_vline;
screen->hline=&lcd_hline;
- screen->scroll_speed=&lcd_scroll_speed;
- screen->scroll_delay=&lcd_scroll_delay;
screen->scroll_step=&lcd_scroll_step;
screen->invertscroll=&lcd_invertscroll;
screen->puts_offset=&lcd_puts_offset;
@@ -175,6 +173,8 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
screen->init=&lcd_init;
screen->puts_scroll=&lcd_puts_scroll;
screen->stop_scroll=&lcd_stop_scroll;
+ screen->scroll_speed=&lcd_scroll_speed;
+ screen->scroll_delay=&lcd_scroll_delay;
screen->clear_display=&lcd_clear_display;
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
screen->update=&lcd_update;
@@ -207,3 +207,26 @@ void screen_access_init(void)
FOR_NB_SCREENS(i)
screen_init(&screens[i], i);
}
+
+void screen_lcd_scroll_speed(int speed)
+{
+ int i;
+ FOR_NB_SCREENS(i)
+ screens[i].scroll_speed(speed);
+}
+
+void screen_lcd_scroll_delay(int ms)
+{
+ int i;
+ FOR_NB_SCREENS(i)
+ screens[i].scroll_delay(ms);
+}
+
+#ifdef HAVE_LCD_BITMAP
+void screen_lcd_scroll_step(int pixels)
+{
+ int i;
+ FOR_NB_SCREENS(i)
+ screens[i].scroll_step(pixels);
+}
+#endif
diff --git a/apps/screen_access.h b/apps/screen_access.h
index ae0a962015..c739c6cb1f 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -185,4 +185,13 @@ extern void screen_access_init(void);
*/
extern struct screen screens[NB_SCREENS];
+
+/*
+ * Functions to apply LCD settings across all screens
+ */
+void screen_lcd_scroll_speed(int speed);
+void screen_lcd_scroll_delay(int ms);
+void screen_lcd_scroll_step(int pixels);
+
+
#endif /*_SCREEN_ACCESS_H_*/
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 14f1b57776..4d80ed8c73 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -55,6 +55,7 @@
#include "yesno.h"
#include "list.h"
#include "color_picker.h"
+#include "screen_access.h"
#ifdef HAVE_LCD_BITMAP
#include "peakmeter.h"
@@ -837,7 +838,7 @@ static bool scroll_speed(void)
{
return set_int(str(LANG_SCROLL), "", UNIT_INT,
&global_settings.scroll_speed,
- &lcd_scroll_speed, 1, 0, 15, NULL );
+ &screen_lcd_scroll_speed, 1, 0, 15, NULL );
}
static bool scroll_delay(void)
@@ -845,7 +846,7 @@ static bool scroll_delay(void)
int dummy = global_settings.scroll_delay * (HZ/10);
int rc = set_int(str(LANG_SCROLL_DELAY), "ms", UNIT_MS,
&dummy,
- &lcd_scroll_delay, 100, 0, 2500, NULL );
+ &screen_lcd_scroll_delay, 100, 0, 2500, NULL );
global_settings.scroll_delay = dummy / (HZ/10);
return rc;
}
@@ -869,7 +870,7 @@ static bool scroll_step(void)
{
return set_int(str(LANG_SCROLL_STEP_EXAMPLE), str(LANG_PIXELS), UNIT_PIXEL,
&global_settings.scroll_step,
- &lcd_scroll_step, 1, 1, LCD_WIDTH, NULL );
+ &screen_lcd_scroll_step, 1, 1, LCD_WIDTH, NULL );
}
#endif