summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-16 23:48:46 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-03-16 19:57:28 -0400
commitb309fae2bc9a505fa9da0c0188b23108938d2998 (patch)
tree2abd3aa4195e7bbf561f9b09418f69862f71a02f
parent67f7d399e5dd3280a2e5126d1b2d673447dc3aba (diff)
downloadrockbox-b309fae2bc.tar.gz
rockbox-b309fae2bc.zip
touchscreen: fix quickscreen
Looks like I made a mistake testing this originally because there's no way this would've worked. Change-Id: I89dc0d831e381eb957cf6e1a801236b5cd829efa
-rw-r--r--apps/gui/quickscreen.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index a7d07f4e33..e403e13e6c 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -288,14 +288,22 @@ static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
static int quickscreen_touchscreen_button(void)
{
short x,y;
- /* only hitting the text counts, everything else is exit */
if (action_get_touchscreen_press(&x, &y) != BUTTON_REL)
return ACTION_NONE;
enum { left=1, right=2, top=4, bottom=8 };
- int bits = (x < LCD_WIDTH/3 ? left : (x > 2*LCD_WIDTH/3 ? 2 : right)) |
- (y < LCD_WIDTH/3 ? top : (y > 2*LCD_WIDTH/3 ? 8 : bottom));
+ int bits = 0;
+
+ if(x < LCD_WIDTH/3)
+ bits |= left;
+ else if(x > 2*LCD_WIDTH/3)
+ bits |= right;
+
+ if(y < LCD_HEIGHT/3)
+ bits |= top;
+ else if(y > 2*LCD_HEIGHT/3)
+ bits |= bottom;
switch(bits) {
case top: