forked from Shinonome/dots-hyprland
sidebar: wifi dialog: esc to close
This commit is contained in:
@@ -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: {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import Quickshell.Hyprland
|
|||||||
|
|
||||||
WindowDialog {
|
WindowDialog {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
WindowDialogTitle {
|
WindowDialogTitle {
|
||||||
text: Translation.tr("Connect to Wi-Fi")
|
text: Translation.tr("Connect to Wi-Fi")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user