Skip to content

Commit fd1064d

Browse files
Cleanups
1 parent d5ceb18 commit fd1064d

2 files changed

Lines changed: 7 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- MposKeyboard: fix q, Q, 1 and ~ button unclickable bug
44
- OSUpdate app: simplify by using ConnectivityManager
55
- API: add facilities for instrumentation (screengrabs, mouse clicks)
6+
- API: move WifiService to mpos.net
67
- UI: pass clicks on invisible "gesture swipe start" are to underlying widget
78
- UI: only show back and down gesture icons on swipe, not on tap
89
- UI: double size of back and down swipe gesture starting areas for easier gestures

internal_filesystem/lib/mpos/ui/gesture_navigation.py

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ def _back_swipe_cb(event):
5858
obj.send_event(lv.EVENT.PRESSED, indev)
5959
obj.send_event(lv.EVENT.CLICKED, indev)
6060
obj.send_event(lv.EVENT.RELEASED, indev)
61-
else:
62-
# print("No object found at tap location")
63-
pass
64-
else:
65-
# print("Movement too large but not enough for back - ignoring")
66-
pass
67-
6861

6962
def _top_swipe_cb(event):
7063
if drawer_open:
@@ -109,13 +102,6 @@ def _top_swipe_cb(event):
109102
obj.send_event(lv.EVENT.PRESSED, indev)
110103
obj.send_event(lv.EVENT.CLICKED, indev)
111104
obj.send_event(lv.EVENT.RELEASED, indev)
112-
else:
113-
# print("No object found at tap location")
114-
pass
115-
else:
116-
print("Movement too large but not enough for top swipe - ignoring")
117-
pass
118-
119105

120106
def handle_back_swipe():
121107
global backbutton
@@ -129,18 +115,15 @@ def handle_back_swipe():
129115
style.set_bg_opa(lv.OPA.TRANSP)
130116
style.set_border_width(0)
131117
style.set_radius(0)
132-
if False: # debug the back swipe zone with a red border
118+
if False: # debug the swipe zone with a red border
133119
style.set_bg_opa(15)
134120
style.set_border_width(4)
135121
style.set_border_color(lv.color_hex(0xFF0000)) # Red border for visibility
136122
style.set_border_opa(lv.OPA._50) # 50% opacity for the border
137123
rect.add_style(style, 0)
138-
#rect.add_flag(lv.obj.FLAG.CLICKABLE) # Make the object clickable
139-
#rect.add_flag(lv.obj.FLAG.GESTURE_BUBBLE) # Allow dragging
140124
rect.add_event_cb(_back_swipe_cb, lv.EVENT.PRESSED, None)
141125
rect.add_event_cb(_back_swipe_cb, lv.EVENT.PRESSING, None)
142126
rect.add_event_cb(_back_swipe_cb, lv.EVENT.RELEASED, None)
143-
#rect.add_event_cb(back_swipe_cb, lv.EVENT.ALL, None)
144127
# button with label that shows up during the dragging:
145128
backbutton = lv.button(lv.layer_top())
146129
backbutton.set_pos(0, round(lv.layer_top().get_height() / 2))
@@ -160,14 +143,14 @@ def handle_top_swipe():
160143
style = lv.style_t()
161144
style.init()
162145
style.set_bg_opa(lv.OPA.TRANSP)
163-
#style.set_bg_opa(15)
164146
style.set_border_width(0)
165147
style.set_radius(0)
166-
#style.set_border_color(lv.color_hex(0xFF0000)) # White border for visibility
167-
#style.set_border_opa(lv.OPA._50) # 50% opacity for the border
148+
if False: # debug the swipe zone with a red border
149+
style.set_bg_opa(15)
150+
style.set_border_width(4)
151+
style.set_border_color(lv.color_hex(0xFF0000)) # Red border for visibility
152+
style.set_border_opa(lv.OPA._50) # 50% opacity for the border
168153
rect.add_style(style, 0)
169-
#rect.add_flag(lv.obj.FLAG.CLICKABLE) # Make the object clickable
170-
#rect.add_flag(lv.obj.FLAG.GESTURE_BUBBLE) # Allow dragging
171154
rect.add_event_cb(_top_swipe_cb, lv.EVENT.PRESSED, None)
172155
rect.add_event_cb(_top_swipe_cb, lv.EVENT.PRESSING, None)
173156
rect.add_event_cb(_top_swipe_cb, lv.EVENT.RELEASED, None)

0 commit comments

Comments
 (0)