Skip to content

fix nav drawer gesture on all screens (#43)#108

Open
Vaibhav-S-Gowda wants to merge 1 commit into
BusKill:masterfrom
Vaibhav-S-Gowda:fix/43-nav-drawer-gesture
Open

fix nav drawer gesture on all screens (#43)#108
Vaibhav-S-Gowda wants to merge 1 commit into
BusKill:masterfrom
Vaibhav-S-Gowda:fix/43-nav-drawer-gesture

Conversation

@Vaibhav-S-Gowda
Copy link
Copy Markdown

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_down calls self._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 return True, 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:

  • Added BusKillNavigationDrawer subclass in src/buskill_gui.py that overrides on_touch_down to grab left-edge touches before dispatching to children
  • Updated src/buskill.kv to use BusKillNavigationDrawer instead of NavigationDrawer
  • Fixed on_touch_down in src/packages/garden/navigationdrawer/__init__.py to guard _main_panel touch dispatch with a col_main check

Testing

Tested swipe gesture on:

  • Home screen (was already working)
  • Settings screen (was broken, now fixed)
  • About screen (was broken, now fixed)
  • Debug Log screen (was broken, now fixed)

Tested on: Linux (Ubuntu 24.04), Kivy 2.3.1

Untested on: macOS, Windows

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
@maltfield
Copy link
Copy Markdown
Member

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?

@maltfield
Copy link
Copy Markdown
Member

@Vaibhav-S-Gowda can you please send us an email so we can send you the CAA?

@Vaibhav-S-Gowda
Copy link
Copy Markdown
Author

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?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Navigation Drawer Gesture on all Screens

2 participants