summaryrefslogtreecommitdiff
path: root/apps/gui/option_select.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2012-07-06 14:28:34 +1000
committerJonathan Gordon <rockbox@jdgordon.info>2012-07-06 14:28:34 +1000
commit68ee7aac6e7a16804ac6880cc076c43502989c92 (patch)
treec352d6ee4e7517d2469c0677123a975f0f66646e /apps/gui/option_select.c
parent65f9df3083623484efccf502c33ecc959555d247 (diff)
downloadrockbox-68ee7aac6e7a16804ac6880cc076c43502989c92.zip
rockbox-68ee7aac6e7a16804ac6880cc076c43502989c92.tar.gz
rockbox-68ee7aac6e7a16804ac6880cc076c43502989c92.tar.bz2
rockbox-68ee7aac6e7a16804ac6880cc076c43502989c92.tar.xz
skin_engine: Make pressing the setting bar touch region work
might need some tweaking, but works. Change-Id: I0784cd4fe9996531da6cc275491ff3b4e83cdbcf
Diffstat (limited to 'apps/gui/option_select.c')
-rw-r--r--apps/gui/option_select.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index f85570d..d42d081 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -600,3 +600,21 @@ int get_setting_info_for_bar(int setting_id, int *count, int *val)
val_to_selection(setting, oldvalue, count, val, &function);
return true;
}
+
+#ifdef HAVE_TOUCHSCREEN
+void update_setting_value_from_touch(int setting_id, int selection)
+{
+ const struct settings_list *setting = &settings[setting_id];
+ int new_val = selection_to_val(setting, selection);
+ int var_type = setting->flags&F_T_MASK;
+
+ if (var_type == F_T_INT || var_type == F_T_UINT)
+ {
+ *(int*)setting->setting = new_val;
+ }
+ else if (var_type == F_T_BOOL)
+ {
+ *(bool*)setting->setting = new_val ? true : false;
+ }
+}
+#endif