@@ -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
6962def _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
120106def 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