summaryrefslogtreecommitdiffstats
path: root/components/package/contents/ui
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-30 15:18:02 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-30 15:18:02 +0200
commit211fdde3ab546142e8aaf9d2b6508c949474b634 (patch)
tree1ddd10924f91f33b1a405f4f8f6593d3d72c32b3 /components/package/contents/ui
parent7339cc0c0a0c63576f38f0bc96c15f28967b92d1 (diff)
downloadkube-211fdde3ab546142e8aaf9d2b6508c949474b634.tar.gz
kube-211fdde3ab546142e8aaf9d2b6508c949474b634.zip
Outbox: added resource state
Diffstat (limited to 'components/package/contents/ui')
-rw-r--r--components/package/contents/ui/Outbox.qml36
1 files changed, 28 insertions, 8 deletions
diff --git a/components/package/contents/ui/Outbox.qml b/components/package/contents/ui/Outbox.qml
index 1f0400d3..f293cfb3 100644
--- a/components/package/contents/ui/Outbox.qml
+++ b/components/package/contents/ui/Outbox.qml
@@ -19,6 +19,7 @@
19import QtQuick 2.4 19import QtQuick 2.4
20import QtQuick.Layouts 1.1 20import QtQuick.Layouts 1.1
21import QtQuick.Controls 2.0 21import QtQuick.Controls 2.0
22import QtQuick.Controls 1.3 as Controls
22 23
23import org.kde.kirigami 1.0 as Kirigami 24import org.kde.kirigami 1.0 as Kirigami
24 25
@@ -30,7 +31,33 @@ import org.kube.components.theme 1.0 as KubeTheme
30Button { 31Button {
31 id: root 32 id: root
32 33
33 text: "outbox" 34 text: outboxModel.count > 0 ? "outbox (" + outboxModel.count + ")" : "outbox"
35 contentItem: Item {
36 Text {
37 text: parent.text
38 font: parent.font
39 horizontalAlignment: Text.AlignHCenter
40 verticalAlignment: Text.AlignVCenter
41 elide: Text.ElideRight
42 }
43 Controls.ToolButton {
44 id: statusIcon
45 anchors {
46 right: parent.right
47 }
48 visible: false
49 states: [
50 State {
51 name: "busy"; when: outboxModel.status == KubeFramework.OutboxModel.InProgressStatus
52 PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.busy; visible: true }
53 },
54 State {
55 name: "error"; when: outboxModel.status == KubeFramework.OutboxModel.ErrorStatus
56 PropertyChanges { target: statusIcon; iconName: KubeTheme.Icons.error; visible: true }
57 }
58 ]
59 }
60 }
34 61
35 onClicked: { 62 onClicked: {
36 dialog.visible = dialog.visible ? false : true 63 dialog.visible = dialog.visible ? false : true
@@ -44,13 +71,6 @@ Button {
44 id: outboxModel 71 id: outboxModel
45 } 72 }
46 73
47 states: [
48 State {
49 name: "noempty"; when: outboxModel.count > 0
50 PropertyChanges { target: root; text: "outbox (" + outboxModel.count + ")" }
51 }
52 ]
53
54 Popup { 74 Popup {
55 id: dialog 75 id: dialog
56 76