1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

fix auto focus app drawer

This commit is contained in:
bbedward
2025-08-20 21:26:09 -04:00
parent bad07df500
commit d20d944d1b

View File

@@ -45,6 +45,14 @@ DankPopout {
WlrLayershell.namespace: "quickshell-launcher"
screen: triggerScreen
onOpened: {
Qt.callLater(() => {
if (contentLoader.item && contentLoader.item.searchField) {
contentLoader.item.searchField.forceActiveFocus()
}
})
}
AppLauncher {
id: appLauncher
@@ -60,6 +68,8 @@ DankPopout {
Rectangle {
id: launcherPanel
property alias searchField: searchField
color: Theme.popupBackground()
radius: Theme.cornerRadius
antialiasing: true
@@ -100,10 +110,6 @@ DankPopout {
anchors.fill: parent
focus: true
Component.onCompleted: {
if (appDrawerPopout.shouldBeVisible)
forceActiveFocus()
}
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Escape) {
appDrawerPopout.close()
@@ -216,18 +222,10 @@ DankPopout {
event.accepted = false
}
}
Component.onCompleted: {
if (appDrawerPopout.shouldBeVisible)
searchField.forceActiveFocus()
}
Connections {
function onShouldBeVisibleChanged() {
if (appDrawerPopout.shouldBeVisible)
Qt.callLater(function () {
searchField.forceActiveFocus()
})
else
if (!appDrawerPopout.shouldBeVisible)
searchField.clearFocus()
}