diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2011-10-17 17:38:10 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2011-10-17 17:38:10 +0000 |
| commit | 3b12634e6bc966cb2b2e7f21e9a435cdd20f0bc4 (patch) | |
| tree | 2f103d5b58b4a22f65e9fd02de4a720022034121 /apps/settings_list.c | |
| parent | 859cd4b627a48cab8273d8f4d04e2afeb0ee7c87 (diff) | |
| download | rockbox-3b12634e6bc966cb2b2e7f21e9a435cdd20f0bc4.zip rockbox-3b12634e6bc966cb2b2e7f21e9a435cdd20f0bc4.tar.gz rockbox-3b12634e6bc966cb2b2e7f21e9a435cdd20f0bc4.tar.bz2 rockbox-3b12634e6bc966cb2b2e7f21e9a435cdd20f0bc4.tar.xz | |
Commit FS#12321 - Touchscreen: List line padding, to more easily select lines
This adds line padding to lists on touchscreens,
in order to make lists reasonably useful without huge fonts.
It's configurable:
* Automatic (default, line height calculated using a lcd dpi aware function)
* Off (status quo, line height = font height)
* X pixels (from 2 to 50 in even steps)
The automatic setting should/aims to Just Work Out Of The Box on all targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30773 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_list.c')
| -rw-r--r-- | apps/settings_list.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c index eb62b9b..a3d6587 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -286,6 +286,29 @@ static const char graphic_numeric[] = "graphic,numeric"; #endif /* HAVE_RECORDING */ +static const char* list_pad_formatter(char *buffer, size_t buffer_size, + int val, const char *unit) +{ + switch (val) + { + case -1: return str(LANG_AUTOMATIC); + case 0: return str(LANG_OFF); + default: break; + } + snprintf(buffer, buffer_size, "%d %s", val, unit); + return buffer; +} + +static int32_t list_pad_getlang(int value, int unit) +{ + switch (value) + { + case -1: return LANG_AUTOMATIC; + case 0: return LANG_OFF; + default: return TALK_ID(value, unit); + } +} + static const char* formatter_unit_0_is_off(char *buffer, size_t buffer_size, int val, const char *unit) { @@ -740,6 +763,12 @@ const struct settings_list settings[] = { INT_SETTING(F_THEMESETTING, scrollbar_width, LANG_SCROLLBAR_WIDTH, 6, "scrollbar width",UNIT_INT, 3, MAX(LCD_WIDTH/10,25), 1, NULL, NULL, NULL), +#ifdef HAVE_TOUCHSCREEN + TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, list_line_padding, LANG_LIST_LINE_PADDING, + -1, "list padding", "off,auto", UNIT_PIXEL, list_pad_formatter, + list_pad_getlang, NULL, 16, + -1,0,2,4,6,8,10,12,16,20,24,28,32,38,44,50), +#endif #if CONFIG_KEYPAD == RECORDER_PAD OFFON_SETTING(F_THEMESETTING,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL), #endif |