Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/buskill.kv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Updated: 2023-06-14
# Version: 0.3
################################################################################

#:import BusKillNavigationDrawer buskill_gui

<CriticalError>:

Expand Down Expand Up @@ -64,7 +64,7 @@
title: '[font=RobotoMedium][size=20] BusKill[/size][/font]'
on_release: root.toggle_menu()

NavigationDrawer:
BusKillNavigationDrawer:
id: nav_drawer
anim_type: 'slide_above_simple'
side_panel_width: min( dp(300), 0.8*self.width )
Expand Down
35 changes: 35 additions & 0 deletions src/buskill_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,41 @@ def get_screen_manager(obj):

return None

class BusKillNavigationDrawer(NavigationDrawer):
"""Fixes issue #43: nav drawer swipe gesture works on all screens.

Root cause: Kivy dispatches on_touch_down to children first. Child
screens (Settings, DebugLog, etc.) consume the touch before the
NavigationDrawer can detect the left-edge swipe gesture.

Fix: grab left-edge touches before dispatching to children.
"""

def on_touch_down(self, touch):
if not self.collide_point(*touch.pos):
return super().on_touch_down(touch)

if self._anim_progress < 0.001:
if touch.x <= self.touch_accept_width:
self._touch = touch
touch.grab(self)
self._start_touch_x = touch.x
self._start_time = touch.time_start
super().on_touch_down(touch)
return True

return super().on_touch_down(touch)

def on_touch_move(self, touch):
if touch.grab_current is self:
return super().on_touch_move(touch)
return super().on_touch_move(touch)

def on_touch_up(self, touch):
if touch.grab_current is self:
return super().on_touch_up(touch)
return super().on_touch_up(touch)

class MainWindow(Screen):

toggle_btn = ObjectProperty(None)
Expand Down
3 changes: 2 additions & 1 deletion src/packages/garden/navigationdrawer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ def on_touch_down(self, touch):
touch.x <=
(self.x + self.touch_accept_width))
if not valid_region:
self._main_panel.on_touch_down(touch)
if col_main:
self._main_panel.on_touch_down(touch)
return False
else:
if col_side and not self._main_above:
Expand Down