diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-11-05 13:15:35 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-11-05 13:15:35 +0000 |
| commit | 91ccc01bcf78e6a06dce5f900242397813c1e50e (patch) | |
| tree | 5176af040a0e3b65bc04bf5cffa4edc9d4f1eadb | |
| parent | f29c4ccc6a05cd21ba49afca676a3060cd60f913 (diff) | |
| download | rockbox-91ccc01bcf78e6a06dce5f900242397813c1e50e.zip rockbox-91ccc01bcf78e6a06dce5f900242397813c1e50e.tar.gz rockbox-91ccc01bcf78e6a06dce5f900242397813c1e50e.tar.bz2 rockbox-91ccc01bcf78e6a06dce5f900242397813c1e50e.tar.xz | |
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
| -rw-r--r-- | apps/menu.c | 24 | ||||
| -rw-r--r-- | apps/settings_list.c | 8 | ||||
| -rw-r--r-- | apps/settings_list.h | 3 |
3 files changed, 30 insertions, 5 deletions
diff --git a/apps/menu.c b/apps/menu.c index 8e96cc4..c657c2c 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 (i<MAX_PATH) + { + strncpy(&padded_title[i], title, + len<MAX_PATH-1-i?len:MAX_PATH-1-i); + i += len; + if (i<MAX_PATH-1) + padded_title[i++] = ' '; + } + padded_title[i] = '\0'; + title = padded_title; + } + option_screen((struct settings_list *)setting, setting->flags&F_TEMPVAR, title); return false; diff --git a/apps/settings_list.c b/apps/settings_list.c index 82f56c2..def6973 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 0859b44..3127dba 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; |