controlcenter: auto-focus reliably for wireless password input
This commit is contained in:
parent
b40b797caf
commit
9a08d6666e
1 changed files with 17 additions and 2 deletions
|
|
@ -170,12 +170,27 @@ Item {
|
||||||
|
|
||||||
property string passwordBuffer: ""
|
property string passwordBuffer: ""
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: root.session.network
|
||||||
|
function onShowPasswordDialogChanged(): void {
|
||||||
|
if (root.session.network.showPasswordDialog) {
|
||||||
|
// Use callLater to ensure focus happens after dialog is fully rendered
|
||||||
|
Qt.callLater(() => {
|
||||||
|
passwordContainer.forceActiveFocus();
|
||||||
|
passwordContainer.passwordBuffer = "";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root
|
target: root
|
||||||
function onVisibleChanged(): void {
|
function onVisibleChanged(): void {
|
||||||
if (root.visible) {
|
if (root.visible) {
|
||||||
passwordContainer.forceActiveFocus();
|
// Use callLater to ensure focus happens after dialog is fully rendered
|
||||||
passwordContainer.passwordBuffer = "";
|
Qt.callLater(() => {
|
||||||
|
passwordContainer.forceActiveFocus();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue