From 86f1e63ed2e56013b77a5d254326a69e454f692d Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 10 Aug 2025 16:03:37 +0700 Subject: [PATCH] stopwatch: clear laps on Start --- .../quickshell/ii/modules/sidebarRight/pomodoro/Stopwatch.qml | 2 +- .config/quickshell/ii/services/TimerService.qml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/sidebarRight/pomodoro/Stopwatch.qml b/.config/quickshell/ii/modules/sidebarRight/pomodoro/Stopwatch.qml index 2f148393..ffc70656 100644 --- a/.config/quickshell/ii/modules/sidebarRight/pomodoro/Stopwatch.qml +++ b/.config/quickshell/ii/modules/sidebarRight/pomodoro/Stopwatch.qml @@ -191,7 +191,7 @@ Item { else TimerService.stopwatchReset() } - enabled: TimerService.stopwatchTime !== 0 + enabled: TimerService.stopwatchTime > 0 || Persistent.states.timer.stopwatch.laps.length > 0 colBackground: TimerService.stopwatchRunning ? Appearance.colors.colLayer2 : Appearance.colors.colErrorContainer colBackgroundHover: TimerService.stopwatchRunning ? Appearance.colors.colLayer2Hover : Appearance.colors.colErrorContainerHover diff --git a/.config/quickshell/ii/services/TimerService.qml b/.config/quickshell/ii/services/TimerService.qml index 5824c01a..e6c8906b 100644 --- a/.config/quickshell/ii/services/TimerService.qml +++ b/.config/quickshell/ii/services/TimerService.qml @@ -125,6 +125,7 @@ Singleton { } function stopwatchResume() { + if (stopwatchTime === 0) Persistent.states.timer.stopwatch.laps = []; Persistent.states.timer.stopwatch.running = true; Persistent.states.timer.stopwatch.start = getCurrentTimeIn10ms() - stopwatchTime; }