@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 = (
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -34,7 +34,7 @@ class TogglesLayoutMici(NavWidget):
|
||||
record_front,
|
||||
record_mic,
|
||||
enable_openpilot,
|
||||
], snap_items=False)
|
||||
])
|
||||
|
||||
# Toggle lists
|
||||
self._refresh_toggles = (
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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] = []
|
||||
|
||||
Reference in New Issue
Block a user