1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-11 23:09:42 -04:00
Files
DankMaterialShell/quickshell/Modals/PolkitAuthSurfaceModal.qml
bbedward b8f4c350a8 quickshell: drop support for 0.2, require 0.3+
- Remove all compat code
- Rewire LegacyNetworkService to use Quickshell.Networking
- Add parentWindow to settings child windows
2026-05-11 13:05:24 -04:00

52 lines
1.2 KiB
QML

import QtQuick
import Quickshell.Wayland
import qs.Common
import qs.Modals.Common
import qs.Services
DankModal {
id: root
property var parentPopout: null
layerNamespace: "dms:polkit-auth-surface"
modalWidth: 460
modalHeight: 220
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
closeOnEscapeKey: true
closeOnBackgroundClick: false
allowStacking: true
keepPopoutsOpen: true
onOpened: {
if (parentPopout)
parentPopout.customKeyboardFocus = WlrKeyboardFocus.None;
Qt.callLater(() => {
if (contentLoader.item) {
contentLoader.item.reset();
contentLoader.item.focusPasswordField();
}
});
}
onDialogClosed: {
if (parentPopout)
parentPopout.customKeyboardFocus = null;
}
Connections {
target: PolkitService.agent
enabled: PolkitService.polkitAvailable
function onIsActiveChanged() {
if (!(PolkitService.agent?.isActive ?? false))
root.close();
}
}
content: PolkitAuthContent {
focus: true
onCloseRequested: root.close()
}
}