ui: fix cellular toggles (#1810)

UI: Fix ToggleSP._render() missing return value breaking toggle callbacks

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
This commit is contained in:
Amy Jeanes
2026-05-03 21:52:35 +02:00
committed by GitHub
parent 3e44c90c68
commit 2182be05ea
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -363,7 +363,7 @@ def simple_button_item_sp(button_text: str | Callable[[], str], callback: Callab
def toggle_item_sp(title: str | Callable[[], str], description: str | Callable[[], str] | None = None, initial_state: bool = False,
callback: Callable | None = None, icon: str = "", enabled: bool | Callable[[], bool] = True, param: str | None = None) -> ListItemSP:
action = ToggleActionSP(initial_state=initial_state, enabled=enabled, callback=callback, param=param)
return ListItemSP(title=title, description=description, action_item=action, icon=icon, callback=callback)
return ListItemSP(title=title, description=description, action_item=action, icon=icon)
def multiple_button_item_sp(title: str | Callable[[], str], description: str | Callable[[], str], buttons: list[str | Callable[[], str]],
+4
View File
@@ -57,3 +57,7 @@ class ToggleSP(Toggle):
knob_y = self._rect.y + style.TOGGLE_BG_HEIGHT / 2
rl.draw_circle(int(knob_x), int(knob_y), KNOB_RADIUS, knob_color)
clicked = self._clicked
self._clicked = False
return clicked