Commit 24f27f47 authored by Nate Graham's avatar Nate Graham 🔩
Browse files

Make "There are no accounts configured" view a bit more consistent

Summary:
We're slowly ambling towards putting the "add new thing" button right in the middle of
the view itself when there are no things configured--right below the message. The Vaults
applet does this for example, and at least one other thing that I can't remember right
now.

The button moves to the bottom-right corner under the view when the view shows at least
one item.

The explanatory string is also tweaked slightly to reflect the new view, and made into a
level 3 Kirigami heading like other similar messages.

Test Plan: {F8174853}

Reviewers: #vdg, #plasma, leinir, bshah

Reviewed By: #plasma, bshah

Subscribers: bshah

Differential Revision: https://phabricator.kde.org/D28040
parent fa90358c
...@@ -77,15 +77,27 @@ ScrollViewKCM { ...@@ -77,15 +77,27 @@ ScrollViewKCM {
] ]
onClicked: kcm.push("AccountDetails.qml", {model: model.services}) onClicked: kcm.push("AccountDetails.qml", {model: model.services})
} }
Controls.Label { ColumnLayout {
id: noAccountsLayout
visible: view.count === 0 visible: view.count === 0
anchors.fill: parent anchors.centerIn: parent
clip: true width: parent.width
enabled: false spacing: Kirigami.Units.gridUnit
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter Kirigami.Heading {
wrapMode: Text.Wrap enabled: false
text: i18nc("A text shown when a user has not yet added any accounts", "You have not added any accounts yet.\n\nClick on \"Add New Account...\" below to do so.") Layout.maximumWidth: parent.width
Layout.alignment: Qt.AlignHCenter
level: 3
wrapMode: Text.Wrap
text: i18nc("A text shown when a user has not yet added any accounts", "No accounts added yet")
}
Controls.Button {
Layout.alignment: Qt.AlignHCenter
text: i18n("Add New Account...")
icon.name: "contact-new"
onClicked: kcm.push("AvailableAccounts.qml")
}
} }
} }
...@@ -96,6 +108,7 @@ ScrollViewKCM { ...@@ -96,6 +108,7 @@ ScrollViewKCM {
footer: RowLayout { footer: RowLayout {
Controls.Button { Controls.Button {
visible: !noAccountsLayout.visible
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: i18n("Add New Account...") text: i18n("Add New Account...")
icon.name: "contact-new" icon.name: "contact-new"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment