From 91ccc01bcf78e6a06dce5f900242397813c1e50e Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 5 Nov 2007 13:15:35 +0000 Subject: fix FS#7288 - pad the title of the scrolling settings so they actually scroll git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15469 a1c6a512-1295-4272-9138-f99709370657 --- apps/menu.c | 24 ++++++++++++++++++++++++ apps/settings_list.c | 8 ++++---- apps/settings_list.h | 3 ++- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/apps/menu.c b/apps/menu.c index 8e96cc4edf..c657c2c1ca 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -282,10 +282,34 @@ bool do_setting_from_menu(const struct menu_item_ex *temp) temp->variable, &setting_id); char *title; + char padded_title[MAX_PATH]; if ((temp->flags&MENU_TYPE_MASK) == MT_SETTING_W_TEXT) title = temp->callback_and_desc->desc; else title = ID2P(setting->lang_id); + + /* this is needed so the scroll settings title + can actually be used to test the setting */ + if (setting->flags&F_PADTITLE) + { + int i = 0, len; + if (setting->lang_id == -1) + title = (char*)setting->cfg_vals; + else + title = P2STR((unsigned char*)title); + len = strlen(title); + while (iflags&F_TEMPVAR, title); return false; diff --git a/apps/settings_list.c b/apps/settings_list.c index 82f56c2bf9..def6973378 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -586,9 +586,9 @@ const struct settings_list settings[] = { TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC), TALK_ID(3, UNIT_SEC), TALK_ID(5, UNIT_SEC), TALK_ID(10, UNIT_SEC)), #endif - INT_SETTING(0, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed", + INT_SETTING(F_PADTITLE, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed", UNIT_INT, 0, 15, 1, NULL, NULL, lcd_scroll_speed), - INT_SETTING(0, scroll_delay, LANG_SCROLL_DELAY, 1000, "scroll delay", + INT_SETTING(F_PADTITLE, scroll_delay, LANG_SCROLL_DELAY, 1000, "scroll delay", UNIT_MS, 0, 2500, 100, NULL, NULL, lcd_scroll_delay) , INT_SETTING(0, bidir_limit, LANG_BIDIR_SCROLL, 50, "bidir limit", @@ -606,9 +606,9 @@ const struct settings_list settings[] = { #ifdef HAVE_LCD_BITMAP OFFON_SETTING(0, offset_out_of_view, LANG_SCREEN_SCROLL_VIEW, false, "Screen Scrolls Out Of View", gui_list_screen_scroll_out_of_view), - INT_SETTING(0, scroll_step, LANG_SCROLL_STEP, 6, "scroll step", + 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(0, screen_scroll_step, LANG_SCREEN_SCROLL_STEP, + INT_SETTING(F_PADTITLE, screen_scroll_step, LANG_SCREEN_SCROLL_STEP, 16, "screen scroll step", UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, gui_list_screen_scroll_step), #endif /* HAVE_LCD_BITMAP */ diff --git a/apps/settings_list.h b/apps/settings_list.h index 0859b440e1..3127dbaf00 100644 --- a/apps/settings_list.h +++ b/apps/settings_list.h @@ -103,10 +103,11 @@ struct choice_setting { - a NVRAM setting is removed */ #define F_TEMPVAR 0x0400 /* used if the setting should be set using a temp var */ +#define F_PADTITLE 0x800 /* pad the title with spaces to force it to scroll */ #define F_NO_WRAP 0x1000 /* used if the list should not wrap */ struct settings_list { - uint32_t flags; /* ____ ___R TFFF ____ NNN_ _TVC IFRB STTT */ + uint32_t flags; /* ____ ___R TFFF ____ NNN_ PTVC IFRB STTT */ void *setting; int lang_id; /* -1 for none */ union storage_type default_val; -- cgit v1.2.3