Calendar: close with esc

This commit is contained in:
ItsLemmy
2025-10-12 18:35:22 -04:00
parent 757049fe30
commit b152df7670
+15
View File
@@ -14,6 +14,7 @@ NPanel {
preferredWidth: (Settings.data.location.showWeekNumberInCalendar ? 400 : 380) * Style.uiScaleRatio
preferredHeight: 520 * Style.uiScaleRatio
panelKeyboardFocus: true
panelContent: ColumnLayout {
id: content
@@ -29,6 +30,20 @@ NPanel {
return (Time.date.getMonth() === grid.month) && (Time.date.getFullYear() === grid.year)
}
Shortcut {
sequence: "Escape"
onActivated: {
if (timerActive) {
cancelTimer()
} else {
cancelTimer()
root.close()
}
}
context: Qt.WidgetShortcut
enabled: root.opened
}
Connections {
target: Time
function onDateChanged() {