Commit a62d9808 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/batterymonitor: work around to leave applet's focus on desktop

The value of previousItemInFocusChain is appletContainer when the applet
is on desktop, but we don't want to establish hidden tab focus relation
between appletContainer and the last battery item, so use `Keys.onTabPressed`
instead.
parent f8f77c17
......@@ -184,6 +184,15 @@ PlasmaExtras.Representation {
KeyNavigation.down: index + 1 < batteryRepeater.count ? batteryRepeater.itemAt(index + 1) : null
KeyNavigation.backtab: KeyNavigation.up
KeyNavigation.tab: KeyNavigation.down
Keys.onTabPressed: {
if (index === batteryRepeater.count - 1) {
// Workaround to leave applet's focus on desktop
nextItemInFocusChain(false).forceActiveFocus(Qt.TabFocusReason);
} else {
event.accepted = false;
}
}
}
}
}
......
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