NavWidget: disable nav bar for vertical scrollers (#36857)

* disable nav bar vert scroller

* cmt
This commit is contained in:
Shane Smiskol
2025-12-13 01:41:01 -08:00
committed by GitHub
parent 350dc6a50f
commit e9255d1e9c

View File

@@ -270,13 +270,17 @@ class NavWidget(Widget, abc.ABC):
in_dismiss_area = mouse_event.pos.y < self._rect.height * self.BACK_TOUCH_AREA_PERCENTAGE
scroller_at_top = False
vertical_scroller = False
# TODO: -20? snapping in WiFi dialog can make offset not be positive at the top
if hasattr(self, '_scroller'):
scroller_at_top = self._scroller.scroll_panel.get_offset() >= -20 and not self._scroller._horizontal
vertical_scroller = not self._scroller._horizontal
elif hasattr(self, '_scroll_panel'):
scroller_at_top = self._scroll_panel.get_offset() >= -20 and not self._scroll_panel._horizontal
vertical_scroller = not self._scroll_panel._horizontal
if in_dismiss_area or scroller_at_top:
# Vertical scrollers need to be at the top to swipe away to prevent erroneous swipes
if (not vertical_scroller and in_dismiss_area) or scroller_at_top:
self._can_swipe_away = True
self._back_button_start_pos = mouse_event.pos