forked from Shinonome/dots-hyprland
pomodoro: remove unnecessary event propagation prevention
This commit is contained in:
@@ -16,32 +16,26 @@ Item {
|
|||||||
|
|
||||||
// These are keybinds for stopwatch and pomodoro
|
// These are keybinds for stopwatch and pomodoro
|
||||||
Keys.onPressed: (event) => {
|
Keys.onPressed: (event) => {
|
||||||
if ((event.key === Qt.Key_PageDown || event.key === Qt.Key_PageUp) && event.modifiers === Qt.NoModifier) {
|
if ((event.key === Qt.Key_PageDown || event.key === Qt.Key_PageUp) && event.modifiers === Qt.NoModifier) { // Switch tabs
|
||||||
if (event.key === Qt.Key_PageDown) {
|
if (event.key === Qt.Key_PageDown) {
|
||||||
currentTab = Math.min(currentTab + 1, root.tabButtonList.length - 1)
|
currentTab = Math.min(currentTab + 1, root.tabButtonList.length - 1)
|
||||||
} 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) {
|
|
||||||
// Toggle start/stop with Space or S key
|
|
||||||
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 key
|
|
||||||
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) {
|
Pomodoro.stopwatchRecordLap()
|
||||||
// record Stopwatch lap with L key, regardless of current Tab
|
|
||||||
Pomodoro.recordLaps()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user