mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-15 09:52:50 -05:00
settings: try to fix focus loss
This commit is contained in:
@@ -45,7 +45,23 @@ DankModal {
|
||||
}
|
||||
content: settingsContent
|
||||
onOpened: () => {
|
||||
Qt.callLater(() => modalFocusScope.forceActiveFocus())
|
||||
Qt.callLater(() => {
|
||||
modalFocusScope.forceActiveFocus()
|
||||
if (contentLoader.item) {
|
||||
contentLoader.item.forceActiveFocus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible && shouldBeVisible) {
|
||||
Qt.callLater(() => {
|
||||
modalFocusScope.forceActiveFocus()
|
||||
if (contentLoader.item) {
|
||||
contentLoader.item.forceActiveFocus()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
modalFocusScope.Keys.onPressed: event => {
|
||||
const tabCount = 11
|
||||
@@ -113,6 +129,14 @@ DankModal {
|
||||
}
|
||||
onDialogClosed: () => {
|
||||
allowStacking = true;
|
||||
if (settingsModal.shouldBeVisible) {
|
||||
Qt.callLater(() => {
|
||||
settingsModal.modalFocusScope.forceActiveFocus()
|
||||
if (settingsModal.contentLoader.item) {
|
||||
settingsModal.contentLoader.item.forceActiveFocus()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +156,14 @@ DankModal {
|
||||
}
|
||||
onDialogClosed: () => {
|
||||
allowStacking = true;
|
||||
if (settingsModal.shouldBeVisible) {
|
||||
Qt.callLater(() => {
|
||||
settingsModal.modalFocusScope.forceActiveFocus()
|
||||
if (settingsModal.contentLoader.item) {
|
||||
settingsModal.contentLoader.item.forceActiveFocus()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user