summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/mail/contents/ui/Mail.qml1
-rw-r--r--components/package/contents/ui/Button.qml23
-rw-r--r--components/package/contents/ui/Outbox.qml41
3 files changed, 35 insertions, 30 deletions
diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml
index a1ff1cb8..9481a033 100644
--- a/components/mail/contents/ui/Mail.qml
+++ b/components/mail/contents/ui/Mail.qml
@@ -357,6 +357,7 @@ Controls2.ApplicationWindow {
357 left: parent.left 357 left: parent.left
358 right: parent.right 358 right: parent.right
359 } 359 }
360 height: Kirigami.Units.gridUnit * 1.5
360 } 361 }
361 } 362 }
362 363
diff --git a/components/package/contents/ui/Button.qml b/components/package/contents/ui/Button.qml
index ceb8d0c3..978f41a6 100644
--- a/components/package/contents/ui/Button.qml
+++ b/components/package/contents/ui/Button.qml
@@ -18,6 +18,7 @@
18 18
19import QtQuick 2.7 19import QtQuick 2.7
20import org.kube.components.theme 1.0 as KubeTheme 20import org.kube.components.theme 1.0 as KubeTheme
21import org.kde.kirigami 1.0 as Kirigami
21 22
22Rectangle { 23Rectangle {
23 id: root 24 id: root
@@ -25,13 +26,29 @@ Rectangle {
25 signal clicked() 26 signal clicked()
26 property alias text: text.text 27 property alias text: text.text
27 property color textColor: KubeTheme.Colors.highlightedTextColor 28 property color textColor: KubeTheme.Colors.highlightedTextColor
29 property string iconName: ""
30 property alias implicitHeight: content.implicitHeight
31 property alias implicitWidth: content.implicitWidth
32 width: implicitWidth
33 height: implicitHeight
28 34
29 clip: true 35 clip: true
30 36
31 Text { 37 Row {
32 id: text 38 id: content
33 anchors.centerIn: parent 39 anchors.centerIn: parent
34 color: root.textColor 40 spacing: Kirigami.Units.smallSpacing
41 Text {
42 id: text
43 anchors.verticalCenter: parent.verticalCenter
44 color: root.textColor
45 }
46 Icon {
47 id: icon
48 anchors.verticalCenter: parent.verticalCenter
49 iconName: root.iconName
50 visible: iconName != ""
51 }
35 } 52 }
36 53
37 MouseArea { 54 MouseArea {
diff --git a/components/package/contents/ui/Outbox.qml b/components/package/contents/ui/Outbox.qml
index e8edb0f4..19646459 100644
--- a/components/package/contents/ui/Outbox.qml
+++ b/components/package/contents/ui/Outbox.qml
@@ -28,36 +28,23 @@ import org.kube.framework.domain 1.0 as KubeFramework
28import org.kube.components 1.0 as KubeComponents 28import org.kube.components 1.0 as KubeComponents
29import org.kube.components.theme 1.0 as KubeTheme 29import org.kube.components.theme 1.0 as KubeTheme
30 30
31Button { 31KubeComponents.Button {
32 id: root 32 id: root
33 33
34 text: outboxModel.count > 0 ? "outbox (" + outboxModel.count + ")" : "outbox" 34 text: outboxModel.count > 0 ? "Outbox (" + outboxModel.count + ")" : "Outbox"
35 contentItem: Item { 35 color: "transparent"
36 Text { 36 textColor: KubeTheme.Colors.highlightedTextColor
37 text: parent.text 37 iconName: ""
38 font: parent.font 38 states: [
39 horizontalAlignment: Text.AlignHCenter 39 State {
40 verticalAlignment: Text.AlignVCenter 40 name: "busy"; when: outboxModel.status == KubeFramework.OutboxModel.InProgressStatus
41 elide: Text.ElideRight 41 PropertyChanges { target: root; iconName: KubeTheme.Icons.busy }
42 },
43 State {
44 name: "error"; when: outboxModel.status == KubeFramework.OutboxModel.ErrorStatus
45 PropertyChanges { target: root; iconName: KubeTheme.Icons.error }
42 } 46 }
43 KubeComponents.Icon { 47 ]
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 }
61 48
62 onClicked: { 49 onClicked: {
63 dialog.visible = dialog.visible ? false : true 50 dialog.visible = dialog.visible ? false : true