diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2012-07-05 22:44:13 +1000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2012-07-05 23:30:06 +1000 |
| commit | 65f9df3083623484efccf502c33ecc959555d247 (patch) | |
| tree | 6d55b2eb2d874166be00306a5cc3a7c67ebea227 /apps/gui/option_select.c | |
| parent | f6d6a4602c9bb94565f8bb421b465a06f215fb7d (diff) | |
| download | rockbox-65f9df3083623484efccf502c33ecc959555d247.zip rockbox-65f9df3083623484efccf502c33ecc959555d247.tar.gz rockbox-65f9df3083623484efccf502c33ecc959555d247.tar.bz2 rockbox-65f9df3083623484efccf502c33ecc959555d247.tar.xz | |
skin_engine: Allow the %St() (setting) skin tag be used as a bar
%St(<setting name>) or %St(<bar tags>, setting, <setting name>)
Change-Id: I71396d683634d4d1ad2357018c4029ecb4229677
Diffstat (limited to 'apps/gui/option_select.c')
| -rw-r--r-- | apps/gui/option_select.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index ca206b8..f85570d 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c @@ -575,3 +575,28 @@ bool option_screen(const struct settings_list *setting, return false; } +int get_setting_info_for_bar(int setting_id, int *count, int *val) +{ + const struct settings_list *setting = &settings[setting_id]; + int var_type = setting->flags&F_T_MASK; + void (*function)(int) = NULL; + int oldvalue; + + if (var_type == F_T_INT || var_type == F_T_UINT) + { + oldvalue = *(int*)setting->setting; + } + else if (var_type == F_T_BOOL) + { + oldvalue = *(bool*)setting->setting?1:0; + } + else + { + *val = 0; + *count = 1; + return false; /* only int/bools can go here */ + } + + val_to_selection(setting, oldvalue, count, val, &function); + return true; +} |