mici scroller: default no snapping (#37316)

* change default

* fix
This commit is contained in:
Shane Smiskol
2026-02-21 22:35:41 -08:00
committed by GitHub
parent cdcc2f6766
commit f99dc2eab2
9 changed files with 9 additions and 9 deletions

View File

@@ -40,7 +40,7 @@ class MiciMainLayout(Widget):
self._alerts_layout,
self._home_layout,
self._onroad_layout,
], spacing=0, pad=0, scroll_indicator=False, edge_shadows=False)
], snap_items=True, spacing=0, pad=0, scroll_indicator=False, edge_shadows=False)
self._scroller.set_reset_scroll_at_show(False)
self._scroller.set_enabled(lambda: self.enabled) # for nav stack

View File

@@ -197,7 +197,7 @@ class MiciOffroadAlerts(Widget):
self._last_refresh = 0.0
# Create vertical scroller
self._scroller = Scroller([], horizontal=False, spacing=12, pad=0, snap_items=False)
self._scroller = Scroller([], horizontal=False, spacing=12, pad=0)
# Create empty state label
self._empty_label = UnifiedLabel(tr("no alerts"), 65, FontWeight.DISPLAY, rl.WHITE,

View File

@@ -65,7 +65,7 @@ class DeveloperLayoutMici(NavWidget):
self._long_maneuver_toggle,
self._alpha_long_toggle,
self._debug_mode_toggle,
], snap_items=False)
])
# Toggle lists
self._refresh_toggles = (

View File

@@ -324,7 +324,7 @@ class DeviceLayoutMici(NavWidget):
regulatory_btn,
reboot_btn,
self._power_off_btn,
], snap_items=False)
])
# Set up back navigation
# TODO: can this somehow be generic in widgets/__init__.py or application.py?

View File

@@ -93,7 +93,7 @@ class NetworkLayoutMici(NavWidget):
self._apn_btn,
self._cellular_metered_btn,
# */
], snap_items=False)
])
# Set initial config
roaming_enabled = ui_state.params.get_bool("GsmRoaming")

View File

@@ -50,7 +50,7 @@ class SettingsLayout(NavWidget):
#BigDialogButton("manual", "", "icons_mici/settings/manual_icon.png", "Check out the mici user\nmanual at comma.ai/setup"),
firehose_btn,
developer_btn,
], snap_items=False)
])
# Set up back navigation
self.set_back_callback(gui_app.pop_widget)

View File

@@ -34,7 +34,7 @@ class TogglesLayoutMici(NavWidget):
record_front,
record_mic,
enable_openpilot,
], snap_items=False)
])
# Toggle lists
self._refresh_toggles = (

View File

@@ -297,7 +297,7 @@ class BigMultiOptionDialog(BigDialogBase):
# Widget doesn't differentiate between click and drag
self._can_click = True
self._scroller = Scroller([], horizontal=False, pad=100, spacing=0, snap_items=True)
self._scroller = Scroller([], horizontal=False, snap_items=True, pad=100, spacing=0)
for option in options:
self._scroller.add_widget(BigDialogOptionButton(option))

View File

@@ -62,7 +62,7 @@ class ScrollIndicator(Widget):
class Scroller(Widget):
def __init__(self, items: list[Widget], horizontal: bool = True, snap_items: bool = True, spacing: int = ITEM_SPACING,
def __init__(self, items: list[Widget], horizontal: bool = True, snap_items: bool = False, spacing: int = ITEM_SPACING,
pad: int = ITEM_SPACING, scroll_indicator: bool = True, edge_shadows: bool = True):
super().__init__()
self._items: list[Widget] = []