From b60acf988721c902388b2ff800106a6880e06106 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 6 Apr 2017 14:29:35 +0200 Subject: make more use of Kube.Button and Popup in accounts --- components/accounts/contents/ui/AccountWizard.qml | 10 ++-- .../accounts/contents/ui/AccountWizardPage.qml | 55 ++++++++++------------ 2 files changed, 28 insertions(+), 37 deletions(-) (limited to 'components/accounts') diff --git a/components/accounts/contents/ui/AccountWizard.qml b/components/accounts/contents/ui/AccountWizard.qml index f7296924..d108b013 100644 --- a/components/accounts/contents/ui/AccountWizard.qml +++ b/components/accounts/contents/ui/AccountWizard.qml @@ -22,7 +22,7 @@ import QtQuick.Controls 2.0 as Controls2 import org.kde.kirigami 1.0 as Kirigami import org.kube.framework 1.0 as Kube -Controls2.Popup { +Kube.Popup { id: popup modal: true @@ -43,10 +43,8 @@ Controls2.Popup { id: mainView Item { - anchors { - fill: parent - margins: Kirigami.Units.largeSpacing * 2 - } + anchors.fill: parent + Kirigami.Heading { id: heading text: "Select your new account type" @@ -54,9 +52,7 @@ Controls2.Popup { } ColumnLayout { - anchors.centerIn: parent - width: parent.width * 0.4 spacing: Kirigami.Units.largeSpacing diff --git a/components/accounts/contents/ui/AccountWizardPage.qml b/components/accounts/contents/ui/AccountWizardPage.qml index a4dc7e25..b693ea11 100644 --- a/components/accounts/contents/ui/AccountWizardPage.qml +++ b/components/accounts/contents/ui/AccountWizardPage.qml @@ -35,6 +35,7 @@ Item { } Controls.ToolButton { + id: backButton iconName: Kube.Icons.goBack tooltip: "go back" onClicked: { @@ -44,10 +45,11 @@ Item { //Item to avoid anchors conflict with stack Item { - - anchors { - fill: parent - margins: Kube.Units.largeSpacing * 2 + anchors{ + top: backButton.bottom + left: parent.left + right: parent.right + bottom: parent.bottom } Kirigami.Heading { @@ -98,8 +100,9 @@ Item { } //This is where we should place the account wizard ui - GridLayout { + Item { id: footer + anchors { bottom: parent.bottom left: parent.left @@ -107,36 +110,28 @@ Item { topMargin: Kube.Units.largeSpacing * 2 } - columns: 2 - columnSpacing: Kube.Units.largeSpacing - rowSpacing: Kube.Units.largeSpacing - - Item { - Layout.fillHeight: true - } + Kube.Button { + anchors { + left: parent.left + bottom: parent.bottom + } - Kirigami.Label { - text: "" + text: "Discard" + onClicked: { + popup.close() + } } - Item { - Layout.fillWidth: true - - Controls.Button { - text: "Discard" - - onClicked: { - popup.close() - } + Kube.PositiveButton { + anchors { + right: parent.right + bottom: parent.bottom } - Controls.Button { - anchors.right: parent.right - text: "Save" - onClicked: { - loader.item.save() - popup.close() - } + text: "Save" + onClicked: { + loader.item.save() + popup.close() } } } -- cgit v1.2.3