diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-06-15 18:32:54 +0200 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-06-15 18:32:54 +0200 |
commit | 6d2b4f84b0efdb6b1d6c207ed2ab6fc06c140ab8 (patch) | |
tree | 28b80bef620072774d17b02b02d1e6c03feae098 /components/package/contents/ui/AccountSwitcher.qml | |
parent | 1949e99b01b223998d40a0bb5ff2ac4b9177bea4 (diff) | |
download | kube-6d2b4f84b0efdb6b1d6c207ed2ab6fc06c140ab8.tar.gz kube-6d2b4f84b0efdb6b1d6c207ed2ab6fc06c140ab8.zip |
add add account / sync / edit account buttons
Diffstat (limited to 'components/package/contents/ui/AccountSwitcher.qml')
-rw-r--r-- | components/package/contents/ui/AccountSwitcher.qml | 129 |
1 files changed, 126 insertions, 3 deletions
diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml index 0e620854..67c34792 100644 --- a/components/package/contents/ui/AccountSwitcher.qml +++ b/components/package/contents/ui/AccountSwitcher.qml | |||
@@ -21,7 +21,130 @@ import QtQuick.Layouts 1.1 | |||
21 | 21 | ||
22 | import org.kube.framework.domain 1.0 as KubeFramework | 22 | import org.kube.framework.domain 1.0 as KubeFramework |
23 | 23 | ||
24 | ComboBox { | 24 | /* |
25 | model: KubeFramework.AccountsModel { } | 25 | C omboBox { ** * |
26 | textRole: "name" | 26 | model: KubeFramework.AccountsModel { } |
27 | textRole: "name" | ||
28 | } */ | ||
29 | |||
30 | Button { | ||
31 | id: accountSwitcher | ||
32 | |||
33 | Layout.fillWidth: true | ||
34 | Layout.fillHeight: true | ||
35 | |||
36 | text: "Account Switcher" | ||
37 | |||
38 | Rectangle { | ||
39 | anchors { | ||
40 | top: parent.bottom | ||
41 | left: parent.left | ||
42 | } | ||
43 | |||
44 | height: 300 | ||
45 | width: 600 | ||
46 | |||
47 | color: "lightgrey" //FIXME create a propper dialog thingy | ||
48 | clip: true | ||
49 | |||
50 | Item { | ||
51 | id: footer | ||
52 | |||
53 | anchors { | ||
54 | bottom: parent.bottom | ||
55 | left: parent.left | ||
56 | right: parent.right | ||
57 | margins: Kirigami.Units.largeSpacing | ||
58 | } | ||
59 | |||
60 | height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1 | ||
61 | width: listView.width | ||
62 | |||
63 | Button { | ||
64 | |||
65 | anchors { | ||
66 | verticalCenter: parent.verticalCenter | ||
67 | right: parent.right | ||
68 | } | ||
69 | |||
70 | text: "Create new Account" | ||
71 | } | ||
72 | |||
73 | Button { | ||
74 | |||
75 | anchors { | ||
76 | verticalCenter: parent.verticalCenter | ||
77 | left: parent.left | ||
78 | } | ||
79 | |||
80 | iconName: "view-refresh" | ||
81 | text: "Sync" | ||
82 | enabled: syncAction.ready | ||
83 | |||
84 | onClicked: { | ||
85 | syncAction.execute() | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | |||
90 | ListView { | ||
91 | id: listView | ||
92 | |||
93 | anchors { | ||
94 | top: parent.top | ||
95 | bottom: footer.top | ||
96 | left: parent.left | ||
97 | right: parent.right | ||
98 | } | ||
99 | |||
100 | clip: true | ||
101 | |||
102 | model: KubeFramework.AccountsModel { } | ||
103 | |||
104 | delegate: Kirigami.AbstractListItem { | ||
105 | id: accountDelegate | ||
106 | |||
107 | enabled: true | ||
108 | supportsMouseEvents: true | ||
109 | |||
110 | contentItem: Item { | ||
111 | height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1 | ||
112 | width: listView.width | ||
113 | |||
114 | RowLayout { | ||
115 | anchors { | ||
116 | left: parent.left | ||
117 | margins: Kirigami.Units.smallSpacing | ||
118 | } | ||
119 | |||
120 | Layout.fillHeight: true | ||
121 | |||
122 | |||
123 | KubeFramework.AccountFactory { | ||
124 | id: accountFactory | ||
125 | accountId: model.accountId | ||
126 | } | ||
127 | |||
128 | Kirigami.Icon { | ||
129 | source: accountFactory.icon | ||
130 | } | ||
131 | |||
132 | Label { | ||
133 | text: model.name === "" ? accountFactory.name : model.name | ||
134 | } | ||
135 | } | ||
136 | Button { | ||
137 | |||
138 | anchors { | ||
139 | right: parent.right | ||
140 | margins: Kirigami.Units.largeSpacing | ||
141 | } | ||
142 | |||
143 | visible: accountDelegate.containsMouse | ||
144 | text: "edit" | ||
145 | } | ||
146 | } | ||
147 | } | ||
148 | } | ||
149 | } | ||
27 | } \ No newline at end of file | 150 | } \ No newline at end of file |