diff --git a/Components/CustomBusyIndicator.qml b/Components/CustomBusyIndicator.qml new file mode 100644 index 0000000..223989e --- /dev/null +++ b/Components/CustomBusyIndicator.qml @@ -0,0 +1,65 @@ +import QtQuick +import QtQuick.Controls.Basic + +BusyIndicator { + id: control + property color color: delegate.color + property int busySize: 64 + + contentItem: Item { + implicitWidth: control.busySize + implicitHeight: control.busySize + + Item { + id: item + x: parent.width / 2 - (control.busySize / 2) + y: parent.height / 2 - (control.busySize / 2) + width: control.busySize + height: control.busySize + opacity: control.running ? 1 : 0 + + Behavior on opacity { + OpacityAnimator { + duration: 250 + } + } + + RotationAnimator { + target: item + running: control.visible && control.running + from: 0 + to: 360 + loops: Animation.Infinite + duration: 1250 + } + + Repeater { + id: repeater + model: 6 + + CustomRect { + id: delegate + x: item.width / 2 - width / 2 + y: item.height / 2 - height / 2 + implicitWidth: 10 + implicitHeight: 10 + radius: 5 + color: control.color + + required property int index + + transform: [ + Translate { + y: -Math.min(item.width, item.height) * 0.5 + 5 + }, + Rotation { + angle: delegate.index / repeater.count * 360 + origin.x: 5 + origin.y: 5 + } + ] + } + } + } + } +} diff --git a/Modules/Polkit/Polkit.qml b/Modules/Polkit/Polkit.qml index 194493f..ea49199 100644 --- a/Modules/Polkit/Polkit.qml +++ b/Modules/Polkit/Polkit.qml @@ -90,7 +90,7 @@ Scope { spacing: 24 IconImage { - source: Quickshell.iconPath(polkitAgent.flow?.iconName) ?? "" + source: Quickshell.iconPath(polkitAgent.flow?.iconName, true) ?? "" implicitSize: 64 mipmap: true @@ -130,16 +130,19 @@ Scope { id: passInput echoMode: polkitAgent.flow?.responseVisible ? TextInput.Normal : TextInput.Password + placeholderText: polkitAgent.flow?.failed ? " Incorrect Password" : " Input Password" selectByMouse: true onAccepted: okButton.clicked() + placeholderTextColor: polkitAgent.flow?.failed ? DynamicColors.palette.m3onError : DynamicColors.palette.m3onSurfaceVariant + Layout.preferredWidth: contentColumn.implicitWidth Layout.preferredHeight: 40 background: CustomRect { radius: 8 implicitHeight: 40 - color: passInput.enabled ? DynamicColors.tPalette.m3surfaceVariant : DynamicColors.tPalette.m3onSurfaceVariant + color: ( polkitAgent.flow?.failed && passInput.text === "" ) ? DynamicColors.palette.m3error : DynamicColors.tPalette.m3surfaceVariant } } @@ -201,24 +204,17 @@ Scope { ColumnLayout { id: textDetailsColumn spacing: 8 - anchors.centerIn: parent + anchors.fill: parent + anchors.margins: 8 opacity: 0 scale: 0.9 CustomText { - Layout.preferredWidth: 650 - text: `cookie: ${polkitAgent.flow?.cookie}` - wrapMode: Text.WordWrap - } - - CustomText { - Layout.preferredWidth: 650 text: `actionId: ${polkitAgent.flow?.actionId}` wrapMode: Text.WordWrap } CustomText { - Layout.preferredWidth: 650 text: `selectedIdentity: ${polkitAgent.flow?.selectedIdentity}` wrapMode: Text.WordWrap } @@ -264,7 +260,6 @@ Scope { Layout.alignment: Qt.AlignRight onClicked: { polkitAgent.flow.submit(passInput.text) - root.shouldShow = false passInput.text = "" passInput.forceActiveFocus() } @@ -295,12 +290,15 @@ Scope { function onIsResponseRequiredChanged() { passInput.text = "" - if ( polkitAgent.flow?.isResponseRequired ) { + if ( polkitAgent.flow?.isResponseRequired ) root.shouldShow = true passInput.forceActiveFocus() - } else { + } + + function onIsSuccessfulChanged() { + if ( polkitAgent.flow?.isSuccessful ) root.shouldShow = false - } + passInput.text = "" } } } diff --git a/shell.qml b/shell.qml index 66f3ed6..4ade83e 100644 --- a/shell.qml +++ b/shell.qml @@ -1,5 +1,6 @@ //@ pragma UseQApplication //@ pragma Env QSG_RENDER_LOOP=threaded +//@ pragma Env QS_NO_RELOAD_POPUP=1 import Quickshell import qs.Modules import qs.Modules.Lock