diff --git a/Modules/Polkit/Polkit.qml b/Modules/Polkit/Polkit.qml index eb57159..7bff94e 100644 --- a/Modules/Polkit/Polkit.qml +++ b/Modules/Polkit/Polkit.qml @@ -73,20 +73,21 @@ Scope { // mask: Region { item: inputPanel } - Rectangle { + CustomRect { id: inputPanel anchors.centerIn: parent color: Colors.tPalette.m3surface - implicitHeight: layout.childrenRect.height + 28 - implicitWidth: layout.childrenRect.width + 32 + implicitHeight: layout.implicitHeight + layout.anchors.margins * 2 + implicitWidth: Math.max(layout.implicitWidth + layout.anchors.margins * 2, 450) opacity: 0 radius: Tokens.rounding.small * 2 ColumnLayout { id: layout - anchors.centerIn: parent + anchors.fill: parent + anchors.margins: Tokens.padding.medium RowLayout { id: contentRow @@ -147,8 +148,8 @@ Scope { TextField { id: passInput + Layout.fillWidth: true Layout.preferredHeight: 40 - Layout.preferredWidth: contentColumn.implicitWidth color: Colors.palette.m3onSurfaceVariant echoMode: polkitAgent.flow?.responseVisible ? TextInput.Normal : TextInput.Password placeholderText: polkitAgent.flow?.failed ? " Incorrect Password" : " Input Password" @@ -189,7 +190,8 @@ Scope { clip: true color: Colors.tPalette.m3surfaceContainerLow implicitHeight: 0 - radius: 16 + implicitWidth: textDetailsColumn.implicitWidth + textDetailsColumn.anchors.margins * 2 + radius: Tokens.rounding.medium visible: true Behavior on open { @@ -197,7 +199,8 @@ Scope { Anim { property: "implicitHeight" target: detailsPanel - to: !detailsPanel.open ? textDetailsColumn.childrenRect.height + 16 : 0 + to: !detailsPanel.open ? textDetailsColumn.implicitHeight + Tokens.padding.small * 2 : 0 + type: Anim.DefaultEffects } Anim { @@ -205,12 +208,6 @@ Scope { target: textDetailsColumn to: !detailsPanel.open ? 1 : 0 } - - Anim { - property: "scale" - target: textDetailsColumn - to: !detailsPanel.open ? 1 : 0.9 - } } } @@ -218,10 +215,9 @@ Scope { id: textDetailsColumn anchors.fill: parent - anchors.margins: 8 + anchors.margins: Tokens.padding.small opacity: 0 - scale: 0.9 - spacing: 8 + spacing: Tokens.spacing.small CustomText { text: `actionId: ${polkitAgent.flow?.actionId}` @@ -239,16 +235,17 @@ Scope { Layout.preferredWidth: contentRow.implicitWidth spacing: 8 - IconTextButton { + IconButton { id: detailsButton Layout.alignment: Qt.AlignLeft + horizontalPadding: Tokens.padding.medium icon: "info" inactiveColor: Colors.palette.m3surfaceContainer inactiveOnColor: Colors.palette.m3onSurface isRound: true shapeMorph: true - text: "Details" + verticalPadding: Tokens.padding.medium onClicked: { panelWindow.detailsOpen = !panelWindow.detailsOpen;