Skip to content
Merged
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
7 changes: 7 additions & 0 deletions openpilot/selfdrive/ui/tests/diff/replay_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def setup_update_available(available: bool = True) -> None:
params.remove("UpdaterTargetBranch")


def set_updater_state(state: str) -> None:
Params().put("UpdaterState", state, block=True)


def setup_calibration_params() -> None:
params = Params()
# live calibration
Expand Down Expand Up @@ -479,6 +483,9 @@ def type_keyboard() -> None:
# === Settings - Software ===
script.setup(lambda: setup_update_available(False), wait_after=0) # start with no update available
script.click(278, 720) # software
script.setup(lambda: set_updater_state("checking...")) # updater mid-check
script.setup(lambda: set_updater_state("downloading...")) # updater mid-download
script.setup(lambda: set_updater_state("idle"), wait_after=0)
for _ in range(2):
script.click(720, 120) # toggle current release notes
script.setup(setup_update_available) # set update available
Expand Down
5 changes: 4 additions & 1 deletion openpilot/system/ui/widgets/list_view.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import math
import os
import pyray as rl
from collections.abc import Callable
Expand Down Expand Up @@ -104,7 +105,9 @@ def get_width_hint(self) -> float:
value_text = self.value
if value_text:
text_width = measure_text_cached(self._font, value_text, ITEM_TEXT_FONT_SIZE).x
return text_width + BUTTON_WIDTH + TEXT_PADDING
# round up so the width survives float32 storage in rl.Rectangle, otherwise the
# value label can come out a fraction of a pixel too narrow and get elided
return math.ceil(text_width) + BUTTON_WIDTH + TEXT_PADDING
else:
return BUTTON_WIDTH

Expand Down
Loading