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:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user