Launcher: restore Tab/BackTab navigation. Fix #737

This commit is contained in:
ItsLemmy
2025-11-13 08:58:40 -05:00
parent 205e73e8e8
commit 8b0c615322
+14 -1
View File
@@ -50,7 +50,10 @@ SmartPanel {
readonly property int badgeSize: Math.round(Style.baseWidgetSize * 1.6)
readonly property int entryHeight: Math.round(badgeSize + Style.marginM * 2)
// Override keyboard handlers from SmartPanel for navigation
// Override keyboard handlers from SmartPanel for navigation.
// Launcher specific: onTabPressed() and onBackTabPressed() are special here.
// They are not coming from SmartPanelWindow as they are consumed by the search field before reaching the panel.
// They are instead being forwared from the search field NTextInput below.
function onTabPressed() {
selectNextWrapped()
}
@@ -346,6 +349,16 @@ SmartPanel {
Component.onCompleted: {
if (searchInput.inputItem) {
searchInput.inputItem.forceActiveFocus()
// Intercept Tab keys before TextField handles them
searchInput.inputItem.Keys.onPressed.connect(function (event) {
if (event.key === Qt.Key_Tab) {
root.onTabPressed()
event.accepted = true
} else if (event.key === Qt.Key_Backtab) {
root.onBackTabPressed()
event.accepted = true
}
})
}
}
}