summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-11-12 19:51:29 +0000
committerSolomon Peachy <pizza@shaftnet.org>2021-11-20 22:07:29 -0500
commita14347a6b3970cb327f6c60f308d93c88b33130d (patch)
tree6f64134f2601b29a057f2eaf9a34dc9efeabe201
parent16a71a19a80932702cc2c03425ee0f831613b1b7 (diff)
downloadrockbox-a14347a6b3970cb327f6c60f308d93c88b33130d.tar.gz
rockbox-a14347a6b3970cb327f6c60f308d93c88b33130d.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.c18
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)
248static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) 248static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
249{ 249{
250 int item; 250 int item;
251 bool invert = false; 251 bool previous = false;
252 switch(button) 252 switch(button)
253 { 253 {
254 case ACTION_QS_TOP: 254 case ACTION_QS_TOP:
255 invert = true;
256 item = QUICKSCREEN_TOP; 255 item = QUICKSCREEN_TOP;
257 break; 256 break;
257
258 case ACTION_QS_LEFT: 258 case ACTION_QS_LEFT:
259 invert = true;
260 item = QUICKSCREEN_LEFT; 259 item = QUICKSCREEN_LEFT;
260 previous = true;
261 break; 261 break;
262 262
263 case ACTION_QS_DOWN: 263 case ACTION_QS_DOWN:
264 item = QUICKSCREEN_BOTTOM; 264 item = QUICKSCREEN_BOTTOM;
265 previous = true;
265 break; 266 break;
266 267
267 case ACTION_QS_RIGHT: 268 case ACTION_QS_RIGHT:
@@ -271,16 +272,11 @@ static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
271 default: 272 default:
272 return false; 273 return false;
273 } 274 }
275
274 if (qs->items[item] == NULL) 276 if (qs->items[item] == NULL)
275 return false; 277 return false;
276#ifdef ASCENDING_INT_SETTINGS 278
277 if (((qs->items[item]->flags & F_INT_SETTING) == F_INT_SETTING) && 279 option_select_next_val(qs->items[item], previous, true);
278 ( button == ACTION_QS_DOWN || button == ACTION_QS_TOP))
279 {
280 invert = !invert;
281 }
282#endif
283 option_select_next_val(qs->items[item], invert, true);
284 talk_qs_option(qs->items[item], false); 280 talk_qs_option(qs->items[item], false);
285 return true; 281 return true;
286} 282}