mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 05:55:37 -05:00
fix wifi password modal
This commit is contained in:
@@ -14,7 +14,7 @@ DankModal {
|
|||||||
visible: wifiPasswordModalVisible
|
visible: wifiPasswordModalVisible
|
||||||
width: 420
|
width: 420
|
||||||
height: 230
|
height: 230
|
||||||
keyboardFocus: "ondemand"
|
keyboardFocus: "exclusive"
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (!visible)
|
if (!visible)
|
||||||
wifiPasswordInput = "";
|
wifiPasswordInput = "";
|
||||||
@@ -39,8 +39,9 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
content: Component {
|
content: Component {
|
||||||
Item {
|
FocusScope {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
focus: true
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -102,8 +103,7 @@ DankModal {
|
|||||||
echoMode: showPasswordCheckbox.checked ? TextInput.Normal : TextInput.Password
|
echoMode: showPasswordCheckbox.checked ? TextInput.Normal : TextInput.Password
|
||||||
placeholderText: "Enter password"
|
placeholderText: "Enter password"
|
||||||
backgroundColor: "transparent"
|
backgroundColor: "transparent"
|
||||||
normalBorderColor: "transparent"
|
focus: true
|
||||||
focusedBorderColor: "transparent"
|
|
||||||
onTextEdited: {
|
onTextEdited: {
|
||||||
wifiPasswordInput = text;
|
wifiPasswordInput = text;
|
||||||
}
|
}
|
||||||
@@ -114,13 +114,25 @@ DankModal {
|
|||||||
passwordInput.text = "";
|
passwordInput.text = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Timer {
|
||||||
function onOpened() {
|
id: focusTimer
|
||||||
passwordInput.forceActiveFocus();
|
interval: 50
|
||||||
|
onTriggered: passwordInput.forceActiveFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDialogClosed() {
|
Component.onCompleted: {
|
||||||
passwordInput.clearFocus();
|
focusTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onOpened() {
|
||||||
|
focusTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onVisibleChanged() {
|
||||||
|
if (root.visible) {
|
||||||
|
focusTimer.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target: root
|
target: root
|
||||||
@@ -264,7 +276,6 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ PanelWindow {
|
|||||||
implicitHeight: 600
|
implicitHeight: 600
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: calendarVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: calendarVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -195,6 +195,9 @@ PanelWindow {
|
|||||||
if (event.key === Qt.Key_Escape) {
|
if (event.key === Qt.Key_Escape) {
|
||||||
calendarVisible = false;
|
calendarVisible = false;
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
|
} else {
|
||||||
|
// Don't handle other keys - let them bubble up to modals
|
||||||
|
event.accepted = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ PanelWindow {
|
|||||||
implicitHeight: 500
|
implicitHeight: 500
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: controlCenterVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: controlCenterVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
@@ -125,6 +125,8 @@ PanelWindow {
|
|||||||
if (event.key === Qt.Key_Escape) {
|
if (event.key === Qt.Key_Escape) {
|
||||||
controlCenterVisible = false;
|
controlCenterVisible = false;
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
|
} else {
|
||||||
|
event.accepted = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user