working polkit update + 1
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+13
-15
@@ -90,7 +90,7 @@ Scope {
|
|||||||
spacing: 24
|
spacing: 24
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
source: Quickshell.iconPath(polkitAgent.flow?.iconName) ?? ""
|
source: Quickshell.iconPath(polkitAgent.flow?.iconName, true) ?? ""
|
||||||
implicitSize: 64
|
implicitSize: 64
|
||||||
mipmap: true
|
mipmap: true
|
||||||
|
|
||||||
@@ -130,16 +130,19 @@ Scope {
|
|||||||
id: passInput
|
id: passInput
|
||||||
|
|
||||||
echoMode: polkitAgent.flow?.responseVisible ? TextInput.Normal : TextInput.Password
|
echoMode: polkitAgent.flow?.responseVisible ? TextInput.Normal : TextInput.Password
|
||||||
|
placeholderText: polkitAgent.flow?.failed ? " Incorrect Password" : " Input Password"
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
onAccepted: okButton.clicked()
|
onAccepted: okButton.clicked()
|
||||||
|
|
||||||
|
placeholderTextColor: polkitAgent.flow?.failed ? DynamicColors.palette.m3onError : DynamicColors.palette.m3onSurfaceVariant
|
||||||
|
|
||||||
Layout.preferredWidth: contentColumn.implicitWidth
|
Layout.preferredWidth: contentColumn.implicitWidth
|
||||||
Layout.preferredHeight: 40
|
Layout.preferredHeight: 40
|
||||||
|
|
||||||
background: CustomRect {
|
background: CustomRect {
|
||||||
radius: 8
|
radius: 8
|
||||||
implicitHeight: 40
|
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 {
|
ColumnLayout {
|
||||||
id: textDetailsColumn
|
id: textDetailsColumn
|
||||||
spacing: 8
|
spacing: 8
|
||||||
anchors.centerIn: parent
|
anchors.fill: parent
|
||||||
|
anchors.margins: 8
|
||||||
opacity: 0
|
opacity: 0
|
||||||
scale: 0.9
|
scale: 0.9
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.preferredWidth: 650
|
|
||||||
text: `cookie: ${polkitAgent.flow?.cookie}`
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.preferredWidth: 650
|
|
||||||
text: `actionId: ${polkitAgent.flow?.actionId}`
|
text: `actionId: ${polkitAgent.flow?.actionId}`
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
Layout.preferredWidth: 650
|
|
||||||
text: `selectedIdentity: ${polkitAgent.flow?.selectedIdentity}`
|
text: `selectedIdentity: ${polkitAgent.flow?.selectedIdentity}`
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
@@ -264,7 +260,6 @@ Scope {
|
|||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
onClicked: {
|
onClicked: {
|
||||||
polkitAgent.flow.submit(passInput.text)
|
polkitAgent.flow.submit(passInput.text)
|
||||||
root.shouldShow = false
|
|
||||||
passInput.text = ""
|
passInput.text = ""
|
||||||
passInput.forceActiveFocus()
|
passInput.forceActiveFocus()
|
||||||
}
|
}
|
||||||
@@ -295,12 +290,15 @@ Scope {
|
|||||||
|
|
||||||
function onIsResponseRequiredChanged() {
|
function onIsResponseRequiredChanged() {
|
||||||
passInput.text = ""
|
passInput.text = ""
|
||||||
if ( polkitAgent.flow?.isResponseRequired ) {
|
if ( polkitAgent.flow?.isResponseRequired )
|
||||||
root.shouldShow = true
|
root.shouldShow = true
|
||||||
passInput.forceActiveFocus()
|
passInput.forceActiveFocus()
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
function onIsSuccessfulChanged() {
|
||||||
|
if ( polkitAgent.flow?.isSuccessful )
|
||||||
root.shouldShow = false
|
root.shouldShow = false
|
||||||
}
|
passInput.text = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
//@ pragma UseQApplication
|
//@ pragma UseQApplication
|
||||||
//@ pragma Env QSG_RENDER_LOOP=threaded
|
//@ pragma Env QSG_RENDER_LOOP=threaded
|
||||||
|
//@ pragma Env QS_NO_RELOAD_POPUP=1
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import qs.Modules
|
import qs.Modules
|
||||||
import qs.Modules.Lock
|
import qs.Modules.Lock
|
||||||
|
|||||||
Reference in New Issue
Block a user