From a14347a6b3970cb327f6c60f308d93c88b33130d Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Fri, 12 Nov 2021 19:51:29 +0000 Subject: 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 --- apps/gui/quickscreen.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'apps') 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; } -- cgit v1.2.3