on xenial help sign in
More work
commit41a6398540b2153f03d1c77daf41e8482311441b authorAndrea Cimitan <andrea.cimitan@gmail.com> dateMon 3 Feb 2014, 19:47 (13 years ago) parent2e3727ee1b2e3b
3 files changed+33−14
qml/Components/SeeMore.qml+20 qml/Dash/Previews/AudioPlayer.qml+3−9 qml/Dash/Previews/TextSummary.qml+10−5
qml/Components/SeeMore.qml+20
@@ -16,15 +16,19 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import Ubuntu.Components.ListItems 0.1
1920
2021Item {
2122 property bool more: false
2223
24+ implicitHeight: seeMoreLabel.height + units.gu(2)
25+
2326 Row {
2427 anchors.centerIn: parent
2528 spacing: units.gu(2)
2629
2730 Label {
31+ id: seeMoreLabel
2832 objectName: "seeMoreLabel"
2933 text: i18n.tr("See more")
3034 opacity: !more ? 0.8 : 0.4
@@ -37,6 +41,22 @@ Item {
3741 }
3842 }
3943
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+
4060 Label {
4161 objectName: "seeLessLabel"
4262 text: i18n.tr("See less")
qml/Dash/Previews/AudioPlayer.qml+3−9
@@ -125,12 +125,10 @@ PreviewWidget {
125125 objectName: "trackTitleLabel"
126126 anchors { top: parent.top; left: parent.left; right: parent.right }
127127 opacity: 0.9
128− color: "white"
128+ color: Theme.palette.selected.backgroundText
129129 fontSize: "small"
130130 horizontalAlignment: Text.AlignLeft
131131 text: modelData["title"]
132− style: Text.Raised
133− styleColor: "black"
134132 elide: Text.ElideRight
135133 }
136134
@@ -140,12 +138,10 @@ PreviewWidget {
140138 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }
141139 visible: text !== ""
142140 opacity: 0.9
143− color: "white"
141+ color: Theme.palette.selected.backgroundText
144142 fontSize: "small"
145143 horizontalAlignment: Text.AlignLeft
146144 text: modelData["subtitle"] !== undefined ? modelData["subtitle"] : ""
147− style: Text.Raised
148− styleColor: "black"
149145 elide: Text.ElideRight
150146 }
151147
@@ -182,12 +178,10 @@ PreviewWidget {
182178 anchors.verticalCenter: parent.verticalCenter
183179 width: parent.column3Width
184180 opacity: 0.9
185− color: "white"
181+ color: Theme.palette.selected.backgroundText
186182 fontSize: "small"
187183 horizontalAlignment: Text.AlignRight
188184 text: audio.lengthToString(modelData["length"])
189− style: Text.Raised
190− styleColor: "black"
191185 }
192186 }
193187 }
qml/Dash/Previews/TextSummary.qml+10−5
@@ -20,6 +20,9 @@ import "../../Components"
2020
2121PreviewWidget {
2222 id: root
23+
24+ readonly property int __maximumCollapsedLineCount: 7
25+
2326 implicitHeight: titleLabel.visible ? titleLabel.height + textLabel.height : textLabel.height
2427
2528 Label {
@@ -39,32 +42,34 @@ PreviewWidget {
3942
4043 Label {
4144 id: textLabel
45+ objectName: "textLabel"
4246 anchors {
4347 left: parent.left
4448 right: parent.right
4549 top: titleLabel.visible ? titleLabel.bottom : parent.top
4650 }
51+ height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (__maximumCollapsedLineCount - 2)
52+ clip: true
4753 fontSize: "medium"
4854 color: Theme.palette.selected.backgroundText
4955 opacity: .8
5056 text: widgetData["text"]
5157 wrapMode: Text.Wrap
5258
53− clip: true
5459 Behavior on height {
55− NumberAnimation { duration: 300 }
60+ UbuntuNumberAnimation {}
5661 }
57−
58− height: seeMore.more ? contentHeight : contentHeight / lineCount * 5
5962 }
6063
6164 SeeMore {
6265 id: seeMore
66+ objectName: "seeMore"
6367 anchors {
6468 left: parent.left
6569 right: parent.right
6670 top: textLabel.bottom
67− topMargin: units.gu(2)
71+ topMargin: units.gu(1)
6872 }
73+ visible: textLabel.lineCount > __maximumCollapsedLineCount
6974 }
7075}