mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-12 07:19:41 -04:00
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
This commit is contained in:
51
quickshell/Modals/PolkitAuthSurfaceModal.qml
Normal file
51
quickshell/Modals/PolkitAuthSurfaceModal.qml
Normal file
@@ -0,0 +1,51 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user