Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions panels/notification/center/GroupNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ NotifyItem {
signal gotoNextItem() // Signal to navigate to next notify item
signal gotoPrevItem() // Signal to navigate to previous notify item

function resetFocus() {
impl.forceActiveFocus()
}

// Focus the first button for Tab navigation into group
function focusFirstButton() {
foldBtn.forceActiveFocus()
Expand Down
4 changes: 4 additions & 0 deletions panels/notification/center/NormalNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ NotifyItem {
signal gotoNextItem()
signal gotoPrevItem()

function resetFocus() {
impl.forceActiveFocus()
}

function focusFirstButton() {
return notifyContent.focusFirstButton()
}
Expand Down
1 change: 1 addition & 0 deletions panels/notification/center/NotifyView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Control {
function tryFocus(retries) {
let item = view.itemAtIndex(idx)
if (item && item.enabled) {
item.resetFocus()
if (!item.focusFirstButton()) {
item.forceActiveFocus()
}
Expand Down
1 change: 1 addition & 0 deletions panels/notification/center/NotifyViewDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ DelegateChooser {
Qt.callLater(function() {
let nextItem = view.itemAtIndex(currentIndex + 1)
if (nextItem && nextItem.enabled) {
nextItem.resetFocus()
nextItem.forceActiveFocus()
}
})
Expand Down
4 changes: 4 additions & 0 deletions panels/notification/center/OverlapNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ NotifyItem {

property var clearButton: notifyContent.clearButtonItem

function resetFocus() {
impl.forceActiveFocus()
}

function focusFirstButton() {
// Focus clear button first, then action buttons
if (clearButton && clearButton.enabled && clearButton.visible) {
Expand Down
9 changes: 8 additions & 1 deletion panels/notification/plugin/NotifyItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,14 @@ NotifyItem {
// From action buttons, go directly to next notification item
root.gotoNextItem()
}
onGotoPrevItem: root.gotoPrevItem()
onGotoPrevItem: {
// Try to focus close button first, if not available go to prev item
if (clearLoader.item && clearLoader.item.enabled) {
clearLoader.item.forceActiveFocus()
} else {
root.gotoPrevItem()
}
}
}
}
}
Expand Down
Loading