diff --git a/polkit-agent/main.qml b/polkit-agent/main.qml index abe6dd3..5a00e1c 100644 --- a/polkit-agent/main.qml +++ b/polkit-agent/main.qml @@ -6,8 +6,18 @@ import FishUI 1.0 as FishUI Item { id: root - width: 550 - height: mainLayout.implicitHeight + _background.radius * 4 + property var heightValue: mainLayout.implicitHeight + FishUI.Units.largeSpacing * 2 + + width: 450 + height: heightValue + + onHeightValueChanged: { + rootWindow.height = heightValue + rootWindow.maximumHeight = heightValue + rootWindow.minimumHeight = heightValue + rootWindow.maximumWidth = root.width + rootWindow.minimumWidth = root.width + } Rectangle { id: _background @@ -40,19 +50,19 @@ Item { RowLayout { id: mainLayout anchors.fill: parent - anchors.margins: FishUI.Theme.bigRadius * 2 + anchors.margins: FishUI.Units.largeSpacing Image { id: icon source: "qrc:/svg/emblem-warning.svg" - sourceSize.width: 96 - sourceSize.height: 96 + sourceSize.width: 64 + sourceSize.height: 64 smooth: true Layout.alignment: Qt.AlignTop } Item { - width: FishUI.Theme.bigRadius * 1.5 + width: FishUI.Units.largeSpacing } ColumnLayout { diff --git a/polkit-agent/polkitagentlistener.cpp b/polkit-agent/polkitagentlistener.cpp index 72b7ab2..37cae8e 100644 --- a/polkit-agent/polkitagentlistener.cpp +++ b/polkit-agent/polkitagentlistener.cpp @@ -70,7 +70,8 @@ void PolKitAgentListener::request(const QString &request, bool echo) PolkitQt1::Identity identity = m_sessionIdentity[session]; connect(m_dialog, &Dialog::finished, this, [=] { - if (m_dialog->identity() == m_sessionIdentity[session].toString() && !m_dialog->password().isEmpty()) { + if (m_dialog->identity() == m_sessionIdentity[session].toString() + && !m_dialog->password().isEmpty()) { session->setResponse(m_dialog->password()); } else { session->cancel();