Verified Commit af6a4329 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/digital-clock: improve left arrow key navigation in year/decade view

parent 692c59b2
Pipeline #219960 passed with stage
in 6 minutes and 28 seconds
......@@ -723,6 +723,7 @@ PlasmaExtras.Representation {
showWeekNumbers: Plasmoid.configuration.showWeekNumbers
showCustomHeader: true
KeyNavigation.left: KeyNavigation.tab
KeyNavigation.tab: addEventButton.visible ? addEventButton : addEventButton.KeyNavigation.down
Keys.onUpPressed: tabbar.currentItem.forceActiveFocus(Qt.BacktabFocusReason);
}
......
......@@ -141,7 +141,7 @@ Item {
KeyNavigation.left: if (index !== 0) {
return repeater.itemAt(index - 1);
} else {
return root.nextItemInFocusChain(false);
return daysCalendar.KeyNavigation.left;
}
KeyNavigation.tab: daysCalendar.KeyNavigation.tab
......
......@@ -352,6 +352,9 @@ Item {
activeFocusOnTab: false
clip: true
KeyNavigation.left: root.showCustomHeader ? root.KeyNavigation.left : tabBar
KeyNavigation.tab: root.showCustomHeader ? root.KeyNavigation.tab : todayButton
Keys.onLeftPressed: Keys.onUpPressed(event);
Keys.onUpPressed: {
if (root.showCustomHeader) {
event.accepted = false;
......@@ -378,7 +381,8 @@ Item {
dateMatchingPrecision: Calendar.MatchYearMonthAndDay
KeyNavigation.tab: root.showCustomHeader ? root.KeyNavigation.tab : todayButton
KeyNavigation.left: swipeView.KeyNavigation.left
KeyNavigation.tab: swipeView.KeyNavigation.tab
onActivated: {
const rowNumber = Math.floor(index / columns);
......@@ -403,7 +407,8 @@ Item {
gridModel: monthModel
KeyNavigation.tab: root.showCustomHeader ? root.KeyNavigation.tab : todayButton
KeyNavigation.left: swipeView.KeyNavigation.left
KeyNavigation.tab: swipeView.KeyNavigation.tab
onActivated: {
calendarBackend.goToMonth(date.monthNumber);
......@@ -425,7 +430,8 @@ Item {
gridModel: yearModel
KeyNavigation.tab: root.showCustomHeader ? root.KeyNavigation.tab : todayButton
KeyNavigation.left: swipeView.KeyNavigation.left
KeyNavigation.tab: swipeView.KeyNavigation.tab
onActivated: {
calendarBackend.goToYear(date.yearNumber);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment