From bc8e7cfa59ebaa3008063279bea0c43ed0aae257 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Mon, 29 Sep 2014 19:40:48 +0200 Subject: [PATCH] even a bit nicer --- shell/contents/components/NotificationStripe.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shell/contents/components/NotificationStripe.qml b/shell/contents/components/NotificationStripe.qml index 20d71372..7b8f5ac5 100644 --- a/shell/contents/components/NotificationStripe.qml +++ b/shell/contents/components/NotificationStripe.qml @@ -44,16 +44,13 @@ Rectangle { } onExpandedChanged: { - if (expanded) { - height = units.gridUnit * 2; - summaryText.text = summary; - } else { + if (expanded && body) { height = units.gridUnit * 4; - if (body) { - summaryText.text = summary + "\n" + body; - } + } else { + height = units.gridUnit * 2; } } + MouseArea { anchors.fill: root drag.axis: Drag.XAxis @@ -129,10 +126,13 @@ Rectangle { Text { id: summaryText anchors.fill: parent + clip: true horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter color: "white" - text: summary + text: summary + (root.expanded ? (body ? "\n" + body : '') : + (body ? '...' : '')) } + } } \ No newline at end of file