From 229492f0550730a62d74935e45087683cb5f88e9 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Mon, 9 Jan 2017 17:50:57 +0100 Subject: add detailed header view --- components/package/contents/ui/SingleMailView.qml | 66 ++++++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) (limited to 'components') diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml index ca6d52f1..d7c3193c 100644 --- a/components/package/contents/ui/SingleMailView.qml +++ b/components/package/contents/ui/SingleMailView.qml @@ -97,6 +97,27 @@ Item { height: headerContent.height + Kirigami.Units.smallSpacing + states: [ + State { + name: "small" + PropertyChanges { target: subject; wrapMode: Text.NoWrap} + PropertyChanges { target: recipients; visible: true} + PropertyChanges { target: to; visible: false} + PropertyChanges { target: cc; visible: false} + PropertyChanges { target: bcc; visible: false} + }, + State { + name: "details" + PropertyChanges { target: subject; wrapMode: Text.WrapAnywhere} + PropertyChanges { target: recipients; visible: false} + PropertyChanges { target: to; visible: true} + PropertyChanges { target: cc; visible: true} + PropertyChanges { target: bcc; visible: true} + } + ] + + state: "small" + Text { id: date_label @@ -157,6 +178,7 @@ Item { } Text { + id: subject width: to.width @@ -170,7 +192,7 @@ Item { } Text { - id: to + id: recipients width: parent.width - goDown.width - Kirigami.Units.smallSpacing @@ -182,6 +204,42 @@ Item { opacity: 0.75 } + Text { + id: to + + width: parent.width - goDown.width - Kirigami.Units.smallSpacing + + text:"to: " + model.to + + wrapMode: Text.WordWrap + color: Kirigami.Theme.textColor + opacity: 0.75 + } + + Text { + id: cc + + width: parent.width - goDown.width - Kirigami.Units.smallSpacing + + text:"cc: " + model.cc + + wrapMode: Text.WordWrap + color: Kirigami.Theme.textColor + opacity: 0.75 + } + + Text { + id: bcc + + width: parent.width - goDown.width - Kirigami.Units.smallSpacing + + text:"bcc: " + model.bcc + + wrapMode: Text.WordWrap + color: Kirigami.Theme.textColor + opacity: 0.75 + } + } Rectangle { id: goDown @@ -216,7 +274,11 @@ Item { Controls1.ToolButton { anchors.fill: parent - iconName: "go-down" + iconName: header.state === "details" ? "go-up" : "go-down" + + onClicked: { + header.state === "details" ? header.state = "small" : header.state = "details" + } } } -- cgit v1.2.3