summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-04-06 14:29:35 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-04-06 14:29:35 +0200
commitb60acf988721c902388b2ff800106a6880e06106 (patch)
treef615879d6160b3a46a5a9e9fb2dad9acafc44908
parent47b61ceb64828c16d40028ca4790baa378214056 (diff)
downloadkube-b60acf988721c902388b2ff800106a6880e06106.tar.gz
kube-b60acf988721c902388b2ff800106a6880e06106.zip
make more use of Kube.Button and Popup in accounts
-rw-r--r--components/accounts/contents/ui/AccountWizard.qml10
-rw-r--r--components/accounts/contents/ui/AccountWizardPage.qml55
2 files changed, 28 insertions, 37 deletions
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
22import org.kde.kirigami 1.0 as Kirigami 22import org.kde.kirigami 1.0 as Kirigami
23import org.kube.framework 1.0 as Kube 23import org.kube.framework 1.0 as Kube
24 24
25Controls2.Popup { 25Kube.Popup {
26 id: popup 26 id: popup
27 27
28 modal: true 28 modal: true
@@ -43,10 +43,8 @@ Controls2.Popup {
43 id: mainView 43 id: mainView
44 44
45 Item { 45 Item {
46 anchors { 46 anchors.fill: parent
47 fill: parent 47
48 margins: Kirigami.Units.largeSpacing * 2
49 }
50 Kirigami.Heading { 48 Kirigami.Heading {
51 id: heading 49 id: heading
52 text: "Select your new account type" 50 text: "Select your new account type"
@@ -54,9 +52,7 @@ Controls2.Popup {
54 } 52 }
55 53
56 ColumnLayout { 54 ColumnLayout {
57
58 anchors.centerIn: parent 55 anchors.centerIn: parent
59
60 width: parent.width * 0.4 56 width: parent.width * 0.4
61 57
62 spacing: Kirigami.Units.largeSpacing 58 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 {
35 } 35 }
36 36
37 Controls.ToolButton { 37 Controls.ToolButton {
38 id: backButton
38 iconName: Kube.Icons.goBack 39 iconName: Kube.Icons.goBack
39 tooltip: "go back" 40 tooltip: "go back"
40 onClicked: { 41 onClicked: {
@@ -44,10 +45,11 @@ Item {
44 45
45 //Item to avoid anchors conflict with stack 46 //Item to avoid anchors conflict with stack
46 Item { 47 Item {
47 48 anchors{
48 anchors { 49 top: backButton.bottom
49 fill: parent 50 left: parent.left
50 margins: Kube.Units.largeSpacing * 2 51 right: parent.right
52 bottom: parent.bottom
51 } 53 }
52 54
53 Kirigami.Heading { 55 Kirigami.Heading {
@@ -98,8 +100,9 @@ Item {
98 } 100 }
99 101
100 //This is where we should place the account wizard ui 102 //This is where we should place the account wizard ui
101 GridLayout { 103 Item {
102 id: footer 104 id: footer
105
103 anchors { 106 anchors {
104 bottom: parent.bottom 107 bottom: parent.bottom
105 left: parent.left 108 left: parent.left
@@ -107,36 +110,28 @@ Item {
107 topMargin: Kube.Units.largeSpacing * 2 110 topMargin: Kube.Units.largeSpacing * 2
108 } 111 }
109 112
110 columns: 2 113 Kube.Button {
111 columnSpacing: Kube.Units.largeSpacing 114 anchors {
112 rowSpacing: Kube.Units.largeSpacing 115 left: parent.left
113 116 bottom: parent.bottom
114 Item { 117 }
115 Layout.fillHeight: true
116 }
117 118
118 Kirigami.Label { 119 text: "Discard"
119 text: "" 120 onClicked: {
121 popup.close()
122 }
120 } 123 }
121 124
122 Item { 125 Kube.PositiveButton {
123 Layout.fillWidth: true 126 anchors {
124 127 right: parent.right
125 Controls.Button { 128 bottom: parent.bottom
126 text: "Discard"
127
128 onClicked: {
129 popup.close()
130 }
131 } 129 }
132 130
133 Controls.Button { 131 text: "Save"
134 anchors.right: parent.right 132 onClicked: {
135 text: "Save" 133 loader.item.save()
136 onClicked: { 134 popup.close()
137 loader.item.save()
138 popup.close()
139 }
140 } 135 }
141 } 136 }
142 } 137 }