diff options
-rw-r--r-- | framework/qml/Outbox.qml | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/framework/qml/Outbox.qml b/framework/qml/Outbox.qml index 6b0a1650..ad398337 100644 --- a/framework/qml/Outbox.qml +++ b/framework/qml/Outbox.qml | |||
@@ -25,37 +25,55 @@ import org.kde.kirigami 1.0 as Kirigami | |||
25 | import org.kube.framework 1.0 as Kube | 25 | import org.kube.framework 1.0 as Kube |
26 | 26 | ||
27 | 27 | ||
28 | Kube.Button { | 28 | Rectangle { |
29 | id: root | 29 | id: root |
30 | 30 | ||
31 | text: outboxModel.count > 0 ? "Outbox (" + outboxModel.count + ")" : "Outbox" | 31 | Kube.OutboxController { |
32 | color: "transparent" | 32 | id: outboxController |
33 | textColor: Kube.Colors.highlightedTextColor | 33 | } |
34 | iconName: "" | 34 | Kube.OutboxModel { |
35 | id: outboxModel | ||
36 | } | ||
37 | |||
35 | states: [ | 38 | states: [ |
36 | State { | 39 | State { |
37 | name: "busy"; when: outboxModel.status == Kube.OutboxModel.InProgressStatus | 40 | name: "busy"; when: outboxModel.status == Kube.OutboxModel.InProgressStatus |
38 | PropertyChanges { target: root; iconName: Kube.Icons.busy } | 41 | PropertyChanges { target: icon; iconName: Kube.Icons.busy_inverted } |
39 | }, | 42 | }, |
40 | State { | 43 | State { |
41 | name: "error"; when: outboxModel.status == Kube.OutboxModel.ErrorStatus | 44 | name: "error"; when: outboxModel.status == Kube.OutboxModel.ErrorStatus |
42 | PropertyChanges { target: root; iconName: Kube.Icons.error } | 45 | PropertyChanges { target: icon; iconName: Kube.Icons.error_inverted } |
43 | } | 46 | } |
44 | ] | 47 | ] |
45 | 48 | ||
46 | onClicked: { | 49 | color: Kube.Colors.textColor |
47 | dialog.visible = dialog.visible ? false : true | 50 | clip: true |
48 | } | 51 | |
49 | 52 | Row { | |
50 | Kube.OutboxController { | 53 | anchors.centerIn: parent |
51 | id: outboxController | 54 | spacing: Kube.Units.smallSpacing |
55 | Text { | ||
56 | id: text | ||
57 | anchors.verticalCenter: parent.verticalCenter | ||
58 | text: outboxModel.count > 0 ? "Outbox (" + outboxModel.count + ")" : "Outbox" | ||
59 | color: Kube.Colors.highlightedTextColor | ||
60 | } | ||
61 | Icon { | ||
62 | id: icon | ||
63 | anchors.verticalCenter: parent.verticalCenter | ||
64 | iconName: "" | ||
65 | visible: iconName != "" | ||
66 | } | ||
52 | } | 67 | } |
53 | 68 | ||
54 | Kube.OutboxModel { | 69 | MouseArea { |
55 | id: outboxModel | 70 | anchors.fill: parent |
71 | onClicked: { | ||
72 | dialog.visible = dialog.visible ? false : true | ||
73 | } | ||
56 | } | 74 | } |
57 | 75 | ||
58 | Popup { | 76 | Kube.Popup { |
59 | id: dialog | 77 | id: dialog |
60 | 78 | ||
61 | height: content.height + Kirigami.Units.smallSpacing * 2 | 79 | height: content.height + Kirigami.Units.smallSpacing * 2 |