sidebar: wifi dialog: esc to close

This commit is contained in:
end-4
2025-08-27 20:13:46 +07:00
parent 2ad304aaf2
commit fc69ca0599
3 changed files with 14 additions and 2 deletions
@@ -12,7 +12,14 @@ Rectangle {
default property alias data: contentColumn.data default property alias data: contentColumn.data
property real backgroundHeight: 600 property real backgroundHeight: 600
property real backgroundAnimationMovementDistance: 60 property real backgroundAnimationMovementDistance: 60
signal dismiss() signal dismiss()
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Escape) {
root.dismiss();
event.accepted = true;
}
}
color: root.show ? Appearance.colors.colScrim : ColorUtils.transparentize(Appearance.colors.colScrim) color: root.show ? Appearance.colors.colScrim : ColorUtils.transparentize(Appearance.colors.colScrim)
Behavior on color { Behavior on color {
@@ -159,7 +159,12 @@ Item {
anchors.fill: parent anchors.fill: parent
active: root.showWifiDialog || item.visible active: root.showWifiDialog || item.visible
onActiveChanged: if (active) item.show = true onActiveChanged: {
if (active) {
item.show = true;
item.forceActiveFocus();
}
}
sourceComponent: WifiDialog { sourceComponent: WifiDialog {
onDismiss: { onDismiss: {