From 005394ca9b4ba83bece5c0e37ad1b340519a6578 Mon Sep 17 00:00:00 2001 From: Vadim Peretokin Date: Thu, 29 Jan 2026 11:14:54 +0100 Subject: [PATCH] Sync tray UI with saved settings on startup --- postured/app.py | 2 ++ postured/tray.py | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/postured/app.py b/postured/app.py index 107de29..439b8f3 100644 --- a/postured/app.py +++ b/postured/app.py @@ -204,6 +204,8 @@ def _start(self): self._print_debug(f"Migrated legacy calibration to {primary_id}") self._update_tray_calibrations() + self.tray.set_sensitivity(self.settings.sensitivity) + self.tray.set_lock_when_away(self.settings.lock_when_away) self.tray.set_notification_mode(self.settings.notification_mode) self.pose_detector.start(self.settings.camera_index) diff --git a/postured/tray.py b/postured/tray.py index 09f7cc8..629ddae 100644 --- a/postured/tray.py +++ b/postured/tray.py @@ -225,6 +225,15 @@ def _on_notification_mode_changed(self, mode: str): self.led_blink_action.setChecked(mode == "led_blink") self.notification_mode_changed.emit(mode) + def set_lock_when_away(self, enabled: bool): + """Update the lock when away checkbox state.""" + self.lock_away_action.setChecked(enabled) + + def set_sensitivity(self, value: float): + """Update the sensitivity radio button selection.""" + for action, v in self.sensitivity_actions: + action.setChecked(v == value) + def set_notification_mode(self, mode: str): """Update notification mode checkbox states.""" self.dim_screen_action.setChecked(mode == "dim_screen")