diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-11-12 19:51:29 +0000 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-11-20 22:07:29 -0500 |
commit | a14347a6b3970cb327f6c60f308d93c88b33130d (patch) | |
tree | 6f64134f2601b29a057f2eaf9a34dc9efeabe201 | |
parent | 16a71a19a80932702cc2c03425ee0f831613b1b7 (diff) | |
download | rockbox-a14347a6b3.tar.gz rockbox-a14347a6b3.zip |
quickscreen: fix non-intuitive behavior of top/bottom items
The behavior of the top/bottom items is not intuitive when used
with settings like volume or brightness -- pressing up will
actually *decrease* the setting, and down will increase it.
This patch inverts the direction, so the top item will increase
the setting.
The reason for this is that historically, the quickscreen seems
to have had only 3 directions -- left, right, and bottom. Bottom
therefore selected the next value, and when top was introduced
it selected the previous value.
The counter-intuitive nature of this was later reported as a bug
on the Fuze V2 and got an incorrect fix (commit 2271995517) under
the assumption that ASCENDING_INT_SETTINGS was the issue.
Change-Id: I3be92534469cea4f5efd81ab024288c052367411
-rw-r--r-- | apps/gui/quickscreen.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index f8bf98d4ee..c6da1bb8dc 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c @@ -248,20 +248,21 @@ static void talk_qs_option(const struct settings_list *opt, bool enqueue) static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) { int item; - bool invert = false; + bool previous = false; switch(button) { case ACTION_QS_TOP: - invert = true; item = QUICKSCREEN_TOP; break; + case ACTION_QS_LEFT: - invert = true; item = QUICKSCREEN_LEFT; + previous = true; break; case ACTION_QS_DOWN: item = QUICKSCREEN_BOTTOM; + previous = true; break; case ACTION_QS_RIGHT: @@ -271,16 +272,11 @@ static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) default: return false; } + if (qs->items[item] == NULL) return false; -#ifdef ASCENDING_INT_SETTINGS - if (((qs->items[item]->flags & F_INT_SETTING) == F_INT_SETTING) && - ( button == ACTION_QS_DOWN || button == ACTION_QS_TOP)) - { - invert = !invert; - } -#endif - option_select_next_val(qs->items[item], invert, true); + + option_select_next_val(qs->items[item], previous, true); talk_qs_option(qs->items[item], false); return true; } |