summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2009-10-03 12:56:16 +0000
committerJeffrey Goode <jeffg7@gmail.com>2009-10-03 12:56:16 +0000
commit22933cc19cdbaf61a037caae4d69699a5b0dc4c2 (patch)
tree1517bf6a9a84f70017e1d746149833a9a0ae0879 /apps
parente7df285a85ea0cf5ba42830d4017b29f9c0b1d73 (diff)
downloadrockbox-22933cc19cdbaf61a037caae4d69699a5b0dc4c2.zip
rockbox-22933cc19cdbaf61a037caae4d69699a5b0dc4c2.tar.gz
rockbox-22933cc19cdbaf61a037caae4d69699a5b0dc4c2.tar.bz2
rockbox-22933cc19cdbaf61a037caae4d69699a5b0dc4c2.tar.xz
FS#10636: Quickscreen incorrect operation when menu has negative step
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22887 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/option_select.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index d806a0a..97c2b75 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -240,21 +240,20 @@ void option_select_next_val(const struct settings_list *setting,
else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING)
{
struct int_setting *info = (struct int_setting *)setting->int_setting;
- int step = info->step;
- if (step < 0)
- step = -step;
+ bool neg_step = (info->step < 0);
if (!previous)
{
- val = *value + step;
- if (val > info->max)
+ val = *value + info->step;
+ if (neg_step ? (val < info->max) : (val > info->max))
val = info->min;
}
else
{
- val = *value - step;
- if (val < info->min)
+ val = *value - info->step;
+ if (neg_step ? (val > info->min) : (val < info->min))
val = info->max;
}
+ *value = val;
if (apply && info->option_callback)
info->option_callback(val);
}
@@ -276,6 +275,7 @@ void option_select_next_val(const struct settings_list *setting,
if (val < min)
val = max;
}
+ *value = val;
}
else if ((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING)
{
@@ -293,6 +293,7 @@ void option_select_next_val(const struct settings_list *setting,
if (val < 0)
val = info->count-1;
}
+ *value = val;
if (apply && info->option_callback)
info->option_callback(val);
}
@@ -311,8 +312,8 @@ void option_select_next_val(const struct settings_list *setting,
break;
}
}
+ *value = val;
}
- *value = val;
}
#endif