From 90d914e10aaa037819526e545ea9606f440adc82 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Tue, 21 Jun 2016 23:40:34 +0200 Subject: almost pixelpefect maildir settings --- .../package/contents/ui/MaildirAccountSettings.qml | 236 +++++++++++---------- 1 file changed, 123 insertions(+), 113 deletions(-) (limited to 'accounts/maildir/package/contents/ui/MaildirAccountSettings.qml') diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml index fab2aa27..cd966dd1 100644 --- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml @@ -28,155 +28,165 @@ import org.kube.accounts.maildir 1.0 as MaildirAccount Item { - id: root - property string accountId - property string accountName - property string icon - - anchors.fill: parent MaildirAccount.MaildirSettings { - id: maildirSettings - accountIdentifier: accountId + id: maildirSettings + accountIdentifier: accountId } - GridLayout { - id: gridLayout + anchors.fill: parent + Item { anchors { fill: parent - margins: Kirigami.Units.largeSpacing + margins: Kirigami.Units.largeSpacing * 2 } - columns: 2 + Kirigami.Heading { + id: heading + text: "Add your Maildir archive" - Kirigami.Label { - Layout.columnSpan: 2 - Layout.fillWidth: true - text: "General:" + color: Kirigami.Theme.highlightColor } - Kirigami.Label { text: "Account Name" } - TextField { - id: name - placeholderText: accountName - Layout.fillWidth: true - text: maildirSettings.accountName - onTextChanged: { maildirSettings.accountName = text; root.accountName = text; } - } + Label { + id: subHeadline - Kirigami.Label { text: "User Name" } - TextField { - placeholderText: "Your Name" - Layout.fillWidth: true - text: maildirSettings.userName - onTextChanged: { maildirSettings.userName = text; } - } + anchors { + left: heading.left + top: heading.bottom + } - Kirigami.Label { text: "Email Address" } - TextField { - placeholderText: "Your EMail Address" - Layout.fillWidth: true - text: maildirSettings.emailAddress - onTextChanged: { maildirSettings.emailAddress = text; } - } + width: parent.width - Kirigami.Label { - Layout.columnSpan: 2 - Layout.fillWidth: true - text: "Maildir:" + text: "To let Kube access your maildir archive, add the path to your archive and give the account a title that will be displayed inside Kube" + //TODO wait for kirgami theme disabled text color + opacity: 0.5 + wrapMode: Text.Wrap } - Kirigami.Label { text: "Path" } - RowLayout { + GridLayout { + anchors { + top:subHeadline.bottom + bottom: parent.bottom + left: parent.left + right: parent.right + topMargin: Kirigami.Units.largeSpacing * 2 + bottomMargin: Kirigami.Units.largeSpacing * 2 + } + + columns: 2 + columnSpacing: Kirigami.Units.largeSpacing + rowSpacing: Kirigami.Units.largeSpacing + + Kirigami.Label { + text: "Display tilte" + Layout.alignment: Qt.AlignRight + } TextField { - id: path - placeholderText: "path" Layout.fillWidth: true - text: maildirSettings.path - onTextChanged: { maildirSettings.path = text; } - validator: maildirSettings.pathValidator - Rectangle { - anchors.fill: parent - opacity: 0.2 - color: path.acceptableInput ? "green" : "yellow" + + text: maildirSettings.accountName + onTextChanged: { + maildirSettings.accountName = text } } - Button { - iconName: "folder" - onClicked: { - fileDialogComponent.createObject(parent); + Kirigami.Label { + text: "Path" + Layout.alignment: Qt.AlignRight + } + RowLayout { + Layout.fillWidth: true + + TextField { + id: path + Layout.fillWidth: true + + text: maildirSettings.path + onTextChanged: { + maildirSettings.path = text + } + validator: maildirSettings.pathValidator + + Rectangle { + anchors.fill: parent + opacity: 0.2 + color: "yellow" + visible: path.acceptableInput == false + } } - Component { - id: fileDialogComponent - FileDialog { - id: fileDialog - visible: true - title: "Please choose the maildir folder" + Button { + iconName: "folder" + + onClicked: { + fileDialogComponent.createObject(parent) + } - selectFolder: true + Component { + id: fileDialogComponent + FileDialog { + id: fileDialog - onAccepted: { - maildirSettings.path = fileDialog.fileUrl - } - onRejected: { + visible: true + title: "Choose the maildir folder" + + selectFolder: true + + onAccepted: { + maildirSettings.path = fileDialog.fileUrl + } } } } } - } - - Kirigami.Label { - Layout.columnSpan: 2 - Layout.fillWidth: true - text: "Smtp:" - } - - Kirigami.Label { text: "Username" } - TextField { - placeholderText: "Username" - Layout.fillWidth: true - text: maildirSettings.smtpUsername - onTextChanged: { maildirSettings.smtpUsername = text; } - } - Label { text: "Password" } - TextField { - placeholderText: "Password" - Layout.fillWidth: true - text: maildirSettings.smtpPassword - onTextChanged: { maildirSettings.smtpPassword = text; } - } + Label { + text: "" + } + CheckBox { + text: "Read only" + } - Kirigami.Label { text: "Server" } - TextField { - id: server - placeholderText: "smtps://mainserver.example.net:465" - Layout.fillWidth: true - text: maildirSettings.smtpServer - onTextChanged: { maildirSettings.smtpServer = text; } - validator: maildirSettings.smtpServerValidator - Rectangle { - anchors.fill: parent - opacity: 0.2 - color: server.acceptableInput ? "green" : "yellow" + Label { + text: "" + Layout.fillHeight: true + } + Label { + text: "" } - } - Button { - text: "Save" - onClicked: { - maildirSettings.save(); + Label { + text: "" } - } - Button { - text: "Remove" - onClicked: { - maildirSettings.remove(); + Item { + Layout.fillWidth: true + + Button { + text: "Delete" + + onClicked: { + maildirSettings.remove() + root.closeDialog() + } + } + + Button { + id: saveButton + + anchors.right: parent.right + + text: "Save" + + onClicked: { + focus: true + maildirSettings.save() + root.closeDialog() + } + } } } } -} +} \ No newline at end of file -- cgit v1.2.3