on xenial help sign in
More work
41a6398Andrea Cimitan
qml/Components/SeeMore.qml+20
@@ -16,15 +16,19 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import Ubuntu.Components.ListItems 0.1
19
20
20Item {
21Item {
21 property bool more: false
22 property bool more: false
22
23
24+ implicitHeight: seeMoreLabel.height + units.gu(2)
25+
23 Row {
26 Row {
24 anchors.centerIn: parent
27 anchors.centerIn: parent
25 spacing: units.gu(2)
28 spacing: units.gu(2)
26
29
27 Label {
30 Label {
31+ id: seeMoreLabel
28 objectName: "seeMoreLabel"
32 objectName: "seeMoreLabel"
29 text: i18n.tr("See more")
33 text: i18n.tr("See more")
30 opacity: !more ? 0.8 : 0.4
34 opacity: !more ? 0.8 : 0.4
@@ -37,6 +41,22 @@ Item {
37 }
41 }
38 }
42 }
39
43
44+ Row {
45+ height: parent.height
46+
47+ Rectangle {
48+ width: units.dp(1)
49+ height: parent.height
50+ opacity: 0.2
51+ color: Theme.palette.selected.backgroundText
52+ }
53+ Rectangle {
54+ width: units.dp(1)
55+ height: parent.height
56+ color: Qt.rgba(1.0, 1.0, 1.0, 0.1)
57+ }
58+ }
59+
40 Label {
60 Label {
41 objectName: "seeLessLabel"
61 objectName: "seeLessLabel"
42 text: i18n.tr("See less")
62 text: i18n.tr("See less")
qml/Dash/Previews/AudioPlayer.qml+3−9
@@ -125,12 +125,10 @@ PreviewWidget {
125 objectName: "trackTitleLabel"
125 objectName: "trackTitleLabel"
126 anchors { top: parent.top; left: parent.left; right: parent.right }
126 anchors { top: parent.top; left: parent.left; right: parent.right }
127 opacity: 0.9
127 opacity: 0.9
128− color: "white"
128+ color: Theme.palette.selected.backgroundText
129 fontSize: "small"
129 fontSize: "small"
130 horizontalAlignment: Text.AlignLeft
130 horizontalAlignment: Text.AlignLeft
131 text: modelData["title"]
131 text: modelData["title"]
132− style: Text.Raised
133− styleColor: "black"
134 elide: Text.ElideRight
132 elide: Text.ElideRight
135 }
133 }
136
134
@@ -140,12 +138,10 @@ PreviewWidget {
140 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }
138 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }
141 visible: text !== ""
139 visible: text !== ""
142 opacity: 0.9
140 opacity: 0.9
143− color: "white"
141+ color: Theme.palette.selected.backgroundText
144 fontSize: "small"
142 fontSize: "small"
145 horizontalAlignment: Text.AlignLeft
143 horizontalAlignment: Text.AlignLeft
146 text: modelData["subtitle"] !== undefined ? modelData["subtitle"] : ""
144 text: modelData["subtitle"] !== undefined ? modelData["subtitle"] : ""
147− style: Text.Raised
148− styleColor: "black"
149 elide: Text.ElideRight
145 elide: Text.ElideRight
150 }
146 }
151
147
@@ -182,12 +178,10 @@ PreviewWidget {
182 anchors.verticalCenter: parent.verticalCenter
178 anchors.verticalCenter: parent.verticalCenter
183 width: parent.column3Width
179 width: parent.column3Width
184 opacity: 0.9
180 opacity: 0.9
185− color: "white"
181+ color: Theme.palette.selected.backgroundText
186 fontSize: "small"
182 fontSize: "small"
187 horizontalAlignment: Text.AlignRight
183 horizontalAlignment: Text.AlignRight
188 text: audio.lengthToString(modelData["length"])
184 text: audio.lengthToString(modelData["length"])
189− style: Text.Raised
190− styleColor: "black"
191 }
185 }
192 }
186 }
193 }
187 }
qml/Dash/Previews/TextSummary.qml+10−5
@@ -20,6 +20,9 @@ import "../../Components"
20
20
21PreviewWidget {
21PreviewWidget {
22 id: root
22 id: root
23+
24+ readonly property int __maximumCollapsedLineCount: 7
25+
23 implicitHeight: titleLabel.visible ? titleLabel.height + textLabel.height : textLabel.height
26 implicitHeight: titleLabel.visible ? titleLabel.height + textLabel.height : textLabel.height
24
27
25 Label {
28 Label {
@@ -39,32 +42,34 @@ PreviewWidget {
39
42
40 Label {
43 Label {
41 id: textLabel
44 id: textLabel
45+ objectName: "textLabel"
42 anchors {
46 anchors {
43 left: parent.left
47 left: parent.left
44 right: parent.right
48 right: parent.right
45 top: titleLabel.visible ? titleLabel.bottom : parent.top
49 top: titleLabel.visible ? titleLabel.bottom : parent.top
46 }
50 }
51+ height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (__maximumCollapsedLineCount - 2)
52+ clip: true
47 fontSize: "medium"
53 fontSize: "medium"
48 color: Theme.palette.selected.backgroundText
54 color: Theme.palette.selected.backgroundText
49 opacity: .8
55 opacity: .8
50 text: widgetData["text"]
56 text: widgetData["text"]
51 wrapMode: Text.Wrap
57 wrapMode: Text.Wrap
52
58
53− clip: true
54 Behavior on height {
59 Behavior on height {
55− NumberAnimation { duration: 300 }
60+ UbuntuNumberAnimation {}
56 }
61 }
57−
58− height: seeMore.more ? contentHeight : contentHeight / lineCount * 5
59 }
62 }
60
63
61 SeeMore {
64 SeeMore {
62 id: seeMore
65 id: seeMore
66+ objectName: "seeMore"
63 anchors {
67 anchors {
64 left: parent.left
68 left: parent.left
65 right: parent.right
69 right: parent.right
66 top: textLabel.bottom
70 top: textLabel.bottom
67− topMargin: units.gu(2)
71+ topMargin: units.gu(1)
68 }
72 }
73+ visible: textLabel.lineCount > __maximumCollapsedLineCount
69 }
74 }
70}
75}