import QtQuick import Quickshell import qs.Common import qs.Services import qs.Widgets FloatingWindow { id: root property bool disablePopupTransparency: true function show() { if (contentLoader.item) contentLoader.item.reset(); visible = true; Qt.callLater(focusContent); } function hide() { visible = false; } function focusContent() { if (contentLoader.item) contentLoader.item.focusPasswordField(); } objectName: "polkitAuthModal" title: I18n.tr("Authentication") minimumSize: Qt.size(460, 220) maximumSize: Qt.size(460, 220) color: Theme.floatingWindowSurface visible: false onClosed: hide() onVisibleChanged: { if (visible) { Qt.callLater(focusContent); return; } if (contentLoader.item) contentLoader.item.reset(); } Connections { target: PolkitService.agent enabled: PolkitService.polkitAvailable function onIsActiveChanged() { if (!(PolkitService.agent?.isActive ?? false)) root.hide(); } } WindowBlur { targetWindow: root blurX: 0 blurY: 0 blurWidth: root.visible ? root.width : 0 blurHeight: root.visible ? root.height : 0 blurRadius: Theme.cornerRadius } Rectangle { anchors.fill: parent radius: Theme.cornerRadius color: "transparent" border.color: BlurService.borderColor border.width: BlurService.borderWidth antialiasing: true z: 100 } Loader { id: contentLoader anchors.fill: parent active: root.visible sourceComponent: PolkitAuthContent { windowControls: windowControls onCloseRequested: root.hide() } } FloatingWindowControls { id: windowControls targetWindow: root } }