From 10394dc130f8117b54e0590f41aadff3ee1f9332 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 8 Oct 2017 11:46:36 +0200 Subject: Support reentering the password from the settings Additionally this fixes the loader sizing to use the implicit size. This means all settings pages need to set an implicit height. --- .../contents/ui/KolabnowAccountSettings.qml | 6 +++--- components/kube/contents/ui/Kube.qml | 5 +++++ framework/qml/EditAccount.qml | 23 ++++++++-------------- framework/qml/Messages.qml | 2 +- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml index 7468669c..01dd3db6 100644 --- a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml +++ b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml @@ -27,6 +27,7 @@ Item { property string heading: qsTr("Connect your Kolab Now account") property string subheadline: qsTr("Please fill in your name and email address.") property bool valid: nameField.acceptableInput && emailField.acceptableInput + implicitHeight: grid.implicitHeight KolabnowAccount.KolabnowSettings { id: kolabnowSettings @@ -43,9 +44,8 @@ Item { } GridLayout { - anchors { - fill: parent - } + id: grid + anchors.fill: parent columns: 2 columnSpacing: Kube.Units.largeSpacing rowSpacing: Kube.Units.largeSpacing diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index 846e5ff2..2d84f1da 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml @@ -101,6 +101,11 @@ Controls2.ApplicationWindow { onMessageReceived: kubeViews.openComposer(true, message.recipients) } + Kube.Listener { + filter: Kube.Messages.requestLogin + onMessageReceived: kubeViews.setLoginView() + } + //BEGIN Shortcuts Shortcut { sequence: StandardKey.Quit diff --git a/framework/qml/EditAccount.qml b/framework/qml/EditAccount.qml index 85df955b..df567e5a 100644 --- a/framework/qml/EditAccount.qml +++ b/framework/qml/EditAccount.qml @@ -59,36 +59,29 @@ Item { wrapMode: Text.Wrap } - Item { - id: accountEdit + Column { anchors { - top:subHeadline.bottom + top: subHeadline.bottom left: parent.left right: parent.right bottom: footer.top topMargin: Kube.Units.largeSpacing * 2 } - + spacing: Kube.Units.largeSpacing Loader { id: loader anchors { - top: parent.top left: parent.left right: parent.right } - //The initial size is somehow necessary so the loader is properly anchored - height: 10 + height: item ? item.implicitHeight : 0 source: accountFactory.uiPath onLoaded: item.accountId = root.accountId } - Item { - id: spacer - anchors { - top: loader.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - } + Kube.Button { + anchors.right: parent.right + text: qsTr("Change Password") + onClicked: Kube.Fabric.postMessage(Kube.Messages.requestLogin, {}) } } diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml index 8d10bc3b..7e415c34 100644 --- a/framework/qml/Messages.qml +++ b/framework/qml/Messages.qml @@ -34,8 +34,8 @@ Item { property string toggleImportant: "toggleImportant" property string moveToFolder: "moveToFolder" property string moveToDrafts: "moveToDrafts" - property string credentials: "credentials" property string unlockKeyring: "unlockKeyring" + property string requestLogin: "requestLogin" property string notification: "notification" property string progressNotification: "progressNotification" -- cgit v1.2.3