pomodoro: accept event on keybind cuz recommended by qt docs

This commit is contained in:
end-4
2025-08-09 22:19:45 +07:00
parent b102e5c1a5
commit fbe17dc3e3
@@ -22,20 +22,24 @@ Item {
} else if (event.key === Qt.Key_PageUp) { } else if (event.key === Qt.Key_PageUp) {
currentTab = Math.max(currentTab - 1, 0) currentTab = Math.max(currentTab - 1, 0)
} }
event.accepted = true
} else if (event.key === Qt.Key_Space || event.key === Qt.Key_S) { // Pause/resume with Space or S } else if (event.key === Qt.Key_Space || event.key === Qt.Key_S) { // Pause/resume with Space or S
if (currentTab === 0) { if (currentTab === 0) {
Pomodoro.togglePomodoro() Pomodoro.togglePomodoro()
} else { } else {
Pomodoro.toggleStopwatch() Pomodoro.toggleStopwatch()
} }
event.accepted = true
} else if (event.key === Qt.Key_R) { // Reset with R } else if (event.key === Qt.Key_R) { // Reset with R
if (currentTab === 0) { if (currentTab === 0) {
Pomodoro.resetPomodoro() Pomodoro.resetPomodoro()
} else { } else {
Pomodoro.stopwatchReset() Pomodoro.stopwatchReset()
} }
event.accepted = true
} else if (event.key === Qt.Key_L) { // Record lap with L } else if (event.key === Qt.Key_L) { // Record lap with L
Pomodoro.stopwatchRecordLap() Pomodoro.stopwatchRecordLap()
event.accepted = true
} }
} }