on xenial help sign in
Added comments to seemore and moved variable
7ef4934Andrea Cimitan
qml/Components/SeeMore.qml+3
@@ -17,7 +17,10 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19
19
20+/*! Widget that can be used in combination with a text area to allow easy 'expand/collapse' functionality. */
21+
20Item {
22Item {
23+ /// type:bool Boolean set to true when it suggests expanded functionality
21 property bool more: false
24 property bool more: false
22
25
23 implicitHeight: seeMoreLabel.height + units.gu(2)
26 implicitHeight: seeMoreLabel.height + units.gu(2)
qml/Dash/Previews/PreviewTextSummary.qml+5−5
@@ -28,9 +28,6 @@ import "../../Components"
28
28
29PreviewWidget {
29PreviewWidget {
30 id: root
30 id: root
31−
32− readonly property int __maximumCollapsedLineCount: 7
33−
34 implicitHeight: titleLabel.visible ? titleLabel.height + textLabel.height : textLabel.height
31 implicitHeight: titleLabel.visible ? titleLabel.height + textLabel.height : textLabel.height
35
32
36 Label {
33 Label {
@@ -52,12 +49,15 @@ PreviewWidget {
52 Label {
49 Label {
53 id: textLabel
50 id: textLabel
54 objectName: "textLabel"
51 objectName: "textLabel"
52+
53+ readonly property int maximumCollapsedLineCount: 7
54+
55 anchors {
55 anchors {
56 left: parent.left
56 left: parent.left
57 right: parent.right
57 right: parent.right
58 top: titleLabel.visible ? titleLabel.bottom : parent.top
58 top: titleLabel.visible ? titleLabel.bottom : parent.top
59 }
59 }
60− height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (__maximumCollapsedLineCount - 2)
60+ height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)
61 clip: true
61 clip: true
62 fontSize: "medium"
62 fontSize: "medium"
63 color: Theme.palette.selected.backgroundText
63 color: Theme.palette.selected.backgroundText
@@ -79,6 +79,6 @@ PreviewWidget {
79 top: textLabel.bottom
79 top: textLabel.bottom
80 topMargin: units.gu(1)
80 topMargin: units.gu(1)
81 }
81 }
82− visible: textLabel.lineCount > __maximumCollapsedLineCount
82+ visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
83 }
83 }
84}
84}