fix nav drawer gesture on all screens (#43)#108
Conversation
Move touch handling so left-edge swipe opens the navigation drawer on Settings, About, and Debug Log screens, not just the home screen. - Added BusKillNavigationDrawer subclass in buskill_gui.py that grabs left-edge touches before dispatching to child screens - Updated buskill.kv to use BusKillNavigationDrawer instead of NavigationDrawer - Fixed on_touch_down in garden.navigationdrawer to guard _main_panel touch dispatch with col_main check
|
Hey @Vaibhav-S-Gowda thanks for the PR :) Unfortunately, I realized that we don't yet have a process for contributors. I'm currently in the process of fixing that here: Please note that we also have a policy not to include contributions from AI: Can you please indicate if you wrote this code yourself, or if you used AI to write this code? |
|
@Vaibhav-S-Gowda can you please send us an email so we can send you the CAA? |
Thanks for checking. To be transparent I used AI assistance for portions of this contribution roughly 60% of the code. I understand if that doesn't align with your contribution policy. Happy to rewrite it manually if that's preferred, or close the PR if not. |
What this PR does
Fixes the navigation drawer swipe gesture so it works on all screens (Settings, About, Debug Log), not just the home screen. Closes #43.
Why
When the drawer is closed,
NavigationDrawer.on_touch_downcallsself._main_panel.on_touch_down(touch)directly for any touch outside the left-edge zone. On child screens like Settings and Debug Log, the main panel's widgets consume the touch and returnTrue, so the drawer gesture never gets a chance to grab it. The home screen happened to work because its layout left the left edge uncovered.How
Three changes:
BusKillNavigationDrawersubclass insrc/buskill_gui.pythat overrideson_touch_downto grab left-edge touches before dispatching to childrensrc/buskill.kvto useBusKillNavigationDrawerinstead ofNavigationDraweron_touch_downinsrc/packages/garden/navigationdrawer/__init__.pyto guard_main_paneltouch dispatch with acol_maincheckTesting
Tested swipe gesture on:
Tested on: Linux (Ubuntu 24.04), Kivy 2.3.1
Untested on: macOS, Windows