diff options
Diffstat (limited to 'components/package/contents/ui')
-rw-r--r-- | components/package/contents/ui/Outbox.qml | 36 |
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 @@ | |||
19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
20 | import QtQuick.Layouts 1.1 | 20 | import QtQuick.Layouts 1.1 |
21 | import QtQuick.Controls 2.0 | 21 | import QtQuick.Controls 2.0 |
22 | import QtQuick.Controls 1.3 as Controls | ||
22 | 23 | ||
23 | import org.kde.kirigami 1.0 as Kirigami | 24 | import org.kde.kirigami 1.0 as Kirigami |
24 | 25 | ||
@@ -30,7 +31,33 @@ import org.kube.components.theme 1.0 as KubeTheme | |||
30 | Button { | 31 | Button { |
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 | ||