Skip to content

Commit 7bfc7b4

Browse files
committed
Modify button response to drag outside of button event
1 parent ed54a41 commit 7bfc7b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/display_button_simpletest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
style=BUTTON_STYLE,
4343
fill_color=BUTTON_FILL_COLOR,
4444
outline_color=BUTTON_OUTLINE_COLOR,
45-
label="HELLO WORLD",
45+
label=BUTTON_LABEL,
4646
label_font=terminalio.FONT,
4747
label_color=BUTTON_LABEL_COLOR,
4848
)
@@ -56,5 +56,7 @@
5656
if p:
5757
if button.contains(p):
5858
button.selected = True
59+
else:
60+
button.selected = False # if touch is dragged outside of button
5961
else:
60-
button.selected = False
62+
button.selected = False # if touch is released

0 commit comments

Comments
 (0)