Skip to content

Commit f8da9dc

Browse files
committed
Add Explicit Quit button
Improve UX, to prompt user to explicitly quit and reset state of connected device
1 parent 879f2bb commit f8da9dc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/core.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,11 @@ def __init__(self):
16381638
self.btn_sharps_flats = pygame_gui.elements.UIButton(
16391639
relative_rect=pygame.Rect((bs.x * 16 + 2, y), (bs.x, bs.y)),
16401640
text='#/b',
1641+
manager=self.gui
1642+
)
1643+
self.btn_quit = pygame_gui.elements.UIButton(
1644+
relative_rect=pygame.Rect((bs.x * 17 + 2, y), (bs.x, bs.y)),
1645+
text='QUIT',
16411646
manager=self.gui
16421647
)
16431648
# self.next_scale = pygame_gui.elements.UIButton(
@@ -2239,6 +2244,8 @@ def logic(self, dt):
22392244
self.prev_mode()
22402245
elif ev.ui_element == self.btn_sharps_flats:
22412246
self.toggle_sharps_flats()
2247+
elif ev.ui_element == self.btn_quit:
2248+
self.quit()
22422249
# elif ev.type == pygame_gui.UI_HORIZONTAL_SLIDER_MOVED:
22432250
# if ev.ui_element == self.slider_velocity:
22442251
# global self.options.velocity_curve

0 commit comments

Comments
 (0)