diff options
Diffstat (limited to 'framework/qml/FolderListView.qml')
-rw-r--r-- | framework/qml/FolderListView.qml | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/framework/qml/FolderListView.qml b/framework/qml/FolderListView.qml index b35b52ed..39cc8ba4 100644 --- a/framework/qml/FolderListView.qml +++ b/framework/qml/FolderListView.qml | |||
@@ -22,9 +22,7 @@ import QtQuick.Controls.Styles 1.4 | |||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 |
23 | 23 | ||
24 | import org.kde.kirigami 1.0 as Kirigami | 24 | import org.kde.kirigami 1.0 as Kirigami |
25 | import org.kube.components 1.0 as KubeComponents | 25 | import org.kube.framework 1.0 as Kube |
26 | import org.kube.components.theme 1.0 as KubeTheme | ||
27 | import org.kube.framework.domain 1.0 as KubeFramework | ||
28 | 26 | ||
29 | Rectangle { | 27 | Rectangle { |
30 | id: root | 28 | id: root |
@@ -32,9 +30,9 @@ Rectangle { | |||
32 | property variant currentFolder: null | 30 | property variant currentFolder: null |
33 | property variant accountId | 31 | property variant accountId |
34 | 32 | ||
35 | color: KubeTheme.Colors.textColor | 33 | color: Kube.Colors.textColor |
36 | 34 | ||
37 | KubeFramework.FolderController { | 35 | Kube.FolderController { |
38 | id: folderController | 36 | id: folderController |
39 | Binding on folder { | 37 | Binding on folder { |
40 | //!! checks for the availability of the type | 38 | //!! checks for the availability of the type |
@@ -71,14 +69,14 @@ Rectangle { | |||
71 | role: "name" | 69 | role: "name" |
72 | } | 70 | } |
73 | 71 | ||
74 | model: KubeFramework.FolderListModel { | 72 | model: Kube.FolderListModel { |
75 | id: folderListModel | 73 | id: folderListModel |
76 | accountId: root.accountId | 74 | accountId: root.accountId |
77 | } | 75 | } |
78 | 76 | ||
79 | onCurrentIndexChanged: { | 77 | onCurrentIndexChanged: { |
80 | model.fetchMore(currentIndex) | 78 | model.fetchMore(currentIndex) |
81 | root.currentFolder = model.data(currentIndex, KubeFramework.FolderListModel.DomainObject) | 79 | root.currentFolder = model.data(currentIndex, Kube.FolderListModel.DomainObject) |
82 | } | 80 | } |
83 | 81 | ||
84 | alternatingRowColors: false | 82 | alternatingRowColors: false |
@@ -90,7 +88,7 @@ Rectangle { | |||
90 | onClicked: { | 88 | onClicked: { |
91 | var index = parent.indexAt(mouse.x, mouse.y) | 89 | var index = parent.indexAt(mouse.x, mouse.y) |
92 | if (index.valid) { | 90 | if (index.valid) { |
93 | folderController.folder = treeView.model.data(index, KubeFramework.FolderListModel.DomainObject) | 91 | folderController.folder = treeView.model.data(index, Kube.FolderListModel.DomainObject) |
94 | contextMenu.popup() | 92 | contextMenu.popup() |
95 | } | 93 | } |
96 | } | 94 | } |
@@ -99,7 +97,7 @@ Rectangle { | |||
99 | style: TreeViewStyle { | 97 | style: TreeViewStyle { |
100 | 98 | ||
101 | rowDelegate: Rectangle { | 99 | rowDelegate: Rectangle { |
102 | color: styleData.selected ? KubeTheme.Colors.highlightColor : KubeTheme.Colors.textColor | 100 | color: styleData.selected ? Kube.Colors.highlightColor : Kube.Colors.textColor |
103 | 101 | ||
104 | height: Kirigami.Units.gridUnit * 1.5 | 102 | height: Kirigami.Units.gridUnit * 1.5 |
105 | width: 20 | 103 | width: 20 |
@@ -107,7 +105,7 @@ Rectangle { | |||
107 | } | 105 | } |
108 | 106 | ||
109 | frame: Rectangle { | 107 | frame: Rectangle { |
110 | color: KubeTheme.Colors.textColor | 108 | color: Kube.Colors.textColor |
111 | } | 109 | } |
112 | 110 | ||
113 | branchDelegate: Item { | 111 | branchDelegate: Item { |
@@ -118,7 +116,7 @@ Rectangle { | |||
118 | 116 | ||
119 | anchors.centerIn: parent | 117 | anchors.centerIn: parent |
120 | 118 | ||
121 | color: KubeTheme.Colors.viewBackgroundColor | 119 | color: Kube.Colors.viewBackgroundColor |
122 | text: styleData.isExpanded ? "-" : "+" | 120 | text: styleData.isExpanded ? "-" : "+" |
123 | } | 121 | } |
124 | 122 | ||
@@ -127,14 +125,14 @@ Rectangle { | |||
127 | 125 | ||
128 | itemDelegate: Rectangle { | 126 | itemDelegate: Rectangle { |
129 | 127 | ||
130 | color: styleData.selected ? KubeTheme.Colors.highlightColor : KubeTheme.Colors.textColor | 128 | color: styleData.selected ? Kube.Colors.highlightColor : Kube.Colors.textColor |
131 | 129 | ||
132 | DropArea { | 130 | DropArea { |
133 | anchors.fill: parent | 131 | anchors.fill: parent |
134 | 132 | ||
135 | Rectangle { | 133 | Rectangle { |
136 | anchors.fill: parent | 134 | anchors.fill: parent |
137 | color: KubeTheme.Colors.viewBackgroundColor | 135 | color: Kube.Colors.viewBackgroundColor |
138 | 136 | ||
139 | opacity: 0.3 | 137 | opacity: 0.3 |
140 | 138 | ||
@@ -162,34 +160,34 @@ Rectangle { | |||
162 | 160 | ||
163 | text: styleData.value | 161 | text: styleData.value |
164 | 162 | ||
165 | color: KubeTheme.Colors.viewBackgroundColor | 163 | color: Kube.Colors.viewBackgroundColor |
166 | } | 164 | } |
167 | KubeComponents.Icon { | 165 | Kube.Icon { |
168 | id: statusIcon | 166 | id: statusIcon |
169 | visible: false | 167 | visible: false |
170 | iconName: "" | 168 | iconName: "" |
171 | states: [ | 169 | states: [ |
172 | State { | 170 | State { |
173 | name: "busy"; when: model.status == KubeFramework.FolderListModel.InProgressStatus | 171 | name: "busy"; when: model.status == Kube.FolderListModel.InProgressStatus |
174 | PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.busy ; visible: styleData.selected } | 172 | PropertyChanges { target: statusIcon; iconName: Kube.Icons.busy ; visible: styleData.selected } |
175 | }, | 173 | }, |
176 | State { | 174 | State { |
177 | name: "error"; when: model.status == KubeFramework.FolderListModel.ErrorStatus | 175 | name: "error"; when: model.status == Kube.FolderListModel.ErrorStatus |
178 | //The error status should only be visible for a moment, otherwise we'll eventually always show errors everywhere. | 176 | //The error status should only be visible for a moment, otherwise we'll eventually always show errors everywhere. |
179 | PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.error; visible: styleData.selected } | 177 | PropertyChanges { target: statusIcon; iconName: Kube.Icons.error; visible: styleData.selected } |
180 | }, | 178 | }, |
181 | State { | 179 | State { |
182 | name: "checkmark"; when: model.status == KubeFramework.FolderListModel.SuccessStatus | 180 | name: "checkmark"; when: model.status == Kube.FolderListModel.SuccessStatus |
183 | //The success status should only be visible for a moment, otherwise we'll eventually always show checkmarks everywhere. | 181 | //The success status should only be visible for a moment, otherwise we'll eventually always show checkmarks everywhere. |
184 | PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.success; visible: styleData.selected } | 182 | PropertyChanges { target: statusIcon; iconName: Kube.Icons.success; visible: styleData.selected } |
185 | } | 183 | } |
186 | ] | 184 | ] |
187 | } | 185 | } |
188 | } | 186 | } |
189 | } | 187 | } |
190 | 188 | ||
191 | backgroundColor: KubeTheme.Colors.textColor | 189 | backgroundColor: Kube.Colors.textColor |
192 | highlightedTextColor: KubeTheme.Colors.highlightedTextColor | 190 | highlightedTextColor: Kube.Colors.highlightedTextColor |
193 | } | 191 | } |
194 | } | 192 | } |
195 | } | 193 | } |