mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-06 14:16:39 +08:00
WifiUi: pause updates while user is scrolling (#36866)
* pause updates while user is scrolling * clean up
This commit is contained in:
@@ -9,6 +9,7 @@ from openpilot.selfdrive.ui.mici.widgets.dialog import BigMultiOptionDialog, Big
|
||||
from openpilot.system.ui.lib.application import gui_app, MousePos, FontWeight
|
||||
from openpilot.system.ui.widgets import Widget, NavWidget
|
||||
from openpilot.system.ui.lib.wifi_manager import WifiManager, Network, SecurityType
|
||||
from openpilot.system.ui.lib.scroll_panel2 import ScrollState
|
||||
|
||||
|
||||
def normalize_ssid(ssid: str) -> str:
|
||||
@@ -366,6 +367,11 @@ class WifiUIMici(BigMultiOptionDialog):
|
||||
self._network_info_page.update_networks(self._networks)
|
||||
|
||||
def _update_buttons(self):
|
||||
# Don't update buttons while user is actively scrolling
|
||||
scroll_state = self._scroller.scroll_panel.state
|
||||
if scroll_state != ScrollState.STEADY:
|
||||
return
|
||||
|
||||
for network in self._networks.values():
|
||||
# pop and re-insert to eliminate stuttering on update (prevents position lost for a frame)
|
||||
network_button_idx = next((i for i, btn in enumerate(self._scroller._items) if btn.option == network.ssid), None)
|
||||
|
||||
Reference in New Issue
Block a user