on xenial help sign in
various tweaks to fonts inside previews
f91b083Andrea Cimitan
qml/Dash/Previews/PreviewAudioPlayback.qml+3−1
@@ -105,7 +105,8 @@ PreviewWidget {
105 anchors { top: parent.top; left: parent.left; right: parent.right }
105 anchors { top: parent.top; left: parent.left; right: parent.right }
106 opacity: 0.9
106 opacity: 0.9
107 color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
107 color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
108− fontSize: "small"
108+ fontSize: "medium"
109+ font.weight: Font.Light
109 horizontalAlignment: Text.AlignLeft
110 horizontalAlignment: Text.AlignLeft
110 text: modelData["title"]
111 text: modelData["title"]
111 elide: Text.ElideRight
112 elide: Text.ElideRight
@@ -140,6 +141,7 @@ PreviewWidget {
140 opacity: 0.9
141 opacity: 0.9
141 color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
142 color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
142 fontSize: "small"
143 fontSize: "small"
144+ font.weight: Font.Light
143 horizontalAlignment: Text.AlignRight
145 horizontalAlignment: Text.AlignRight
144 text: DashAudioPlayer.lengthToString(modelData["length"])
146 text: DashAudioPlayer.lengthToString(modelData["length"])
145 }
147 }
qml/Dash/Previews/PreviewComment.qml+3
@@ -41,6 +41,7 @@ PreviewWidget {
41 source: widgetData["source"]
41 source: widgetData["source"]
42 }
42 }
43 radius: "medium"
43 radius: "medium"
44+ aspect: UbuntuShape.Flat
44 opacity: source.status === Image.Ready ? 1 : 0
45 opacity: source.status === Image.Ready ? 1 : 0
45 visible: widgetData["source"] !== ""
46 visible: widgetData["source"] !== ""
46 }
47 }
@@ -70,6 +71,7 @@ PreviewWidget {
70 visible: text !== ""
71 visible: text !== ""
71 text: widgetData["subtitle"] || ""
72 text: widgetData["subtitle"] || ""
72 fontSize: "xx-small"
73 fontSize: "xx-small"
74+ font.weight: Font.Light
73 maximumLineCount: 1
75 maximumLineCount: 1
74 elide: Text.ElideRight
76 elide: Text.ElideRight
75 }
77 }
@@ -77,6 +79,7 @@ PreviewWidget {
77 width: parent.width
79 width: parent.width
78 text: widgetData["comment"] || ""
80 text: widgetData["comment"] || ""
79 fontSize: "small"
81 fontSize: "small"
82+ font.weight: Font.Light
80 wrapMode: Text.Wrap
83 wrapMode: Text.Wrap
81 }
84 }
82 }
85 }
qml/Dash/Previews/PreviewHeader.qml+5−3
@@ -60,7 +60,8 @@ PreviewWidget {
60 anchors {
60 anchors {
61 top: parent.top; left: parent.left; right: parent.right
61 top: parent.top; left: parent.left; right: parent.right
62 margins: margins
62 margins: margins
63+ topMargin: 0
63− leftMargin: spacing
64+ leftMargin: 0
64 rightMargin: spacing
65 rightMargin: spacing
65 }
66 }
66
67
@@ -83,6 +84,7 @@ PreviewWidget {
83 sourceFillMode: UbuntuShape.PreserveAspectCrop
84 sourceFillMode: UbuntuShape.PreserveAspectCrop
84 sourceHorizontalAlignment: UbuntuShape.AlignHCenter
85 sourceHorizontalAlignment: UbuntuShape.AlignHCenter
85 sourceVerticalAlignment: UbuntuShape.AlignVCenter
86 sourceVerticalAlignment: UbuntuShape.AlignVCenter
87+ aspect: UbuntuShape.Flat
86 source: Image {
88 source: Image {
87 source: headerRoot.mascot
89 source: headerRoot.mascot
88 width: source ? mascotShapeLoader.width : 0
90 width: source ? mascotShapeLoader.width : 0
@@ -113,8 +115,8 @@ PreviewWidget {
113 rightMargin: iconLoader.width > 0 ? units.gu(0.5) : 0
115 rightMargin: iconLoader.width > 0 ? units.gu(0.5) : 0
114 }
116 }
115 elide: Text.ElideRight
117 elide: Text.ElideRight
116− font.weight: Font.Normal
117 fontSize: "large"
118 fontSize: "large"
119+ font.weight: Font.Light
118 wrapMode: Text.Wrap
120 wrapMode: Text.Wrap
119 color: headerRoot.fontColor
121 color: headerRoot.fontColor
120 text: headerRoot.title
122 text: headerRoot.title
@@ -145,7 +147,7 @@ PreviewWidget {
145 id: subtitleLabel
147 id: subtitleLabel
146 objectName: "subtitleLabel"
148 objectName: "subtitleLabel"
147 elide: Text.ElideRight
149 elide: Text.ElideRight
148− fontSize: "small"
150+ fontSize: "x-small"
149 font.weight: Font.Light
151 font.weight: Font.Light
150 color: headerRoot.fontColor
152 color: headerRoot.fontColor
151 text: headerRoot.subtitle
153 text: headerRoot.subtitle
qml/Dash/Previews/PreviewIconActions.qml+1
@@ -71,6 +71,7 @@ PreviewWidget {
71 anchors.left: icon.right
71 anchors.left: icon.right
72 anchors.leftMargin: visible ? units.gu(0.5) : 0
72 anchors.leftMargin: visible ? units.gu(0.5) : 0
73 text: modelData.label
73 text: modelData.label
74+ font.weight: Font.Light
74 visible: text !== ""
75 visible: text !== ""
75 }
76 }
76
77
qml/Dash/Previews/PreviewRatingInput.qml+1
@@ -103,6 +103,7 @@ PreviewWidget {
103 objectName: "ratingLabel"
103 objectName: "ratingLabel"
104 anchors { left: parent.left; right: parent.right; }
104 anchors { left: parent.left; right: parent.right; }
105 fontSize: "large"
105 fontSize: "large"
106+ font.weight: Font.Light
106 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
107 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
107 opacity: .8
108 opacity: .8
108 text: widgetData["rating-label"] || i18n.tr("Rate this")
109 text: widgetData["rating-label"] || i18n.tr("Rate this")
qml/Dash/Previews/PreviewRatingSingleDisplay.qml+12−9
@@ -30,6 +30,16 @@ Column {
30 property alias urlIconHalf: ratingItem.urlIconHalf
30 property alias urlIconHalf: ratingItem.urlIconHalf
31 property alias labelColor: authorLabel.color
31 property alias labelColor: authorLabel.color
32
32
33+ Label {
34+ id: authorLabel
35+ objectName: "authorLabel"
36+ anchors { left: parent.left; right: parent.right }
37+ opacity: .8
38+ fontSize: "small"
39+ visible: text !== ""
40+ wrapMode: Text.Wrap
41+ }
42+
33 Rating {
43 Rating {
34 id: ratingItem
44 id: ratingItem
35 objectName: "rating"
45 objectName: "rating"
@@ -42,21 +52,14 @@ Column {
42 property var urlIconHalf
52 property var urlIconHalf
43 }
53 }
44
54
45− Label {
46− id: authorLabel
47− objectName: "authorLabel"
48− anchors { left: parent.left; right: parent.right }
49− opacity: .8
50− visible: text !== ""
51− wrapMode: Text.Wrap
52− }
53−
54 Label {
55 Label {
55 id: reviewLabel
56 id: reviewLabel
56 objectName: "reviewLabel"
57 objectName: "reviewLabel"
57 anchors { left: parent.left; right: parent.right }
58 anchors { left: parent.left; right: parent.right }
58 color: authorLabel.color
59 color: authorLabel.color
59 opacity: .8
60 opacity: .8
61+ fontSize: "x-small"
62+ font.weight: Font.Light
60 visible: text !== ""
63 visible: text !== ""
61 wrapMode: Text.Wrap
64 wrapMode: Text.Wrap
62 }
65 }
qml/Dash/Previews/PreviewTable.qml+2−1
@@ -48,6 +48,7 @@ PreviewWidget {
48 }
48 }
49 height: visible ? implicitHeight : 0
49 height: visible ? implicitHeight : 0
50 fontSize: "large"
50 fontSize: "large"
51+ font.weight: Font.Light
51 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
52 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
52 visible: text !== ""
53 visible: text !== ""
53 opacity: .8
54 opacity: .8
@@ -73,7 +74,7 @@ PreviewWidget {
73 text: perRowRepeater.model[index]
74 text: perRowRepeater.model[index]
74 visible: root.expanded || rowIndex < maximumCollapsedRowCount
75 visible: root.expanded || rowIndex < maximumCollapsedRowCount
75 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
76 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
76− font.bold: index == 0
77+ font.weight: index == 0 ? Font.Normal : Font.Light
77 wrapMode: Text.Wrap
78 wrapMode: Text.Wrap
78 Layout.alignment: Qt.AlignTop
79 Layout.alignment: Qt.AlignTop
79 Layout.maximumWidth: column.width - x
80 Layout.maximumWidth: column.width - x
qml/Dash/Previews/PreviewTextSummary.qml+7−2
@@ -39,6 +39,7 @@ PreviewWidget {
39 }
39 }
40 height: visible ? implicitHeight : 0
40 height: visible ? implicitHeight : 0
41 fontSize: "large"
41 fontSize: "large"
42+ font.weight: Font.Light
42 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
43 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
43 visible: text !== ""
44 visible: text !== ""
44 opacity: .8
45 opacity: .8
@@ -56,17 +57,21 @@ PreviewWidget {
56 left: parent.left
57 left: parent.left
57 right: parent.right
58 right: parent.right
58 top: titleLabel.visible ? titleLabel.bottom : parent.top
59 top: titleLabel.visible ? titleLabel.bottom : parent.top
60+ topMargin: titleLabel.visible && visible ? units.gu(1.5) : 0
59 }
61 }
60− height: (lineCount <= maximumCollapsedLineCount || root.expanded) ? contentHeight : contentHeight / lineCount * maximumCollapsedLineCount
62+ height: visible ? (lineCount <= maximumCollapsedLineCount || root.expanded) ? contentHeight : contentHeight / lineCount * maximumCollapsedLineCount : 0
61 clip: true
63 clip: true
62− fontSize: "small"
64+ fontSize: "medium"
65+ font.weight: Font.Light
63 lineHeight: 1.2
66 lineHeight: 1.2
64 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
67 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
68+ visible: text !== ""
65 opacity: .8
69 opacity: .8
66 text: widgetData["text"] || ""
70 text: widgetData["text"] || ""
67 wrapMode: Text.Wrap
71 wrapMode: Text.Wrap
68
72
69 Behavior on height {
73 Behavior on height {
74+ enabled: textLabel.lineCount > textLabel.maximumCollapsedLineCount
70 UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
75 UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
71 }
76 }
72 }
77 }
tests/qmltests/Dash/Previews/tst_Preview.qml+3−3
@@ -87,7 +87,7 @@ Rectangle {
87
87
88 tryCompareFunction(function () {
88 tryCompareFunction(function () {
89 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
89 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
90− return bottomLeft.y <= preview.height
90+ return bottomLeft.y <= preview.height + 1 // FIXME the +1 is to workaround https://bugreports.qt.io/browse/QTBUG-56961
91 }, true);
91 }, true);
92 }
92 }
93
93
@@ -102,7 +102,7 @@ Rectangle {
102
102
103 tryCompareFunction(function () {
103 tryCompareFunction(function () {
104 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
104 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
105− return bottomLeft.y <= preview.height
105+ return bottomLeft.y <= preview.height + 1 // FIXME the +1 is to workaround https://bugreports.qt.io/browse/QTBUG-56961
106 }, true);
106 }, true);
107 }
107 }
108
108
@@ -125,7 +125,7 @@ Rectangle {
125 // Make sure the combo bottom is on the viewport
125 // Make sure the combo bottom is on the viewport
126 tryCompareFunction(function () {
126 tryCompareFunction(function () {
127 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
127 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
128− return bottomLeft.y <= preview.height
128+ return bottomLeft.y <= preview.height + 1 // FIXME the +1 is to workaround https://bugreports.qt.io/browse/QTBUG-56961
129 }, true);
129 }, true);
130 }
130 }
131 }
131 }
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml+1−1
@@ -123,7 +123,7 @@ Rectangle {
123
123
124 function test_dimensions_data() {
124 function test_dimensions_data() {
125 return [
125 return [
126− { tag: "Column width with mascot", object: column, width: previewHeader.width - mascotShapeLoader.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
126+ { tag: "Column width with mascot", object: column, width: previewHeader.width - mascotShapeLoader.width - outerRow.margins * 2, mascot: "artwork/avatar.png" },
127 { tag: "Header height", object: previewHeader, height: function() { return outerRow.height + outerRow.margins * 2 } },
127 { tag: "Header height", object: previewHeader, height: function() { return outerRow.height + outerRow.margins * 2 } },
128 ]
128 ]
129 }
129 }
tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml+2−2
@@ -64,7 +64,7 @@ Rectangle {
64 function test_optional_title() {
64 function test_optional_title() {
65 // verify titleLabel is visible and textLabel is anchored below it
65 // verify titleLabel is visible and textLabel is anchored below it
66 compare(titleLabel.visible, true)
66 compare(titleLabel.visible, true)
67− tryCompare(textLabel, "y", titleLabel.height)
67+ tryCompare(textLabel, "y", titleLabel.height + textLabel.anchors.topMargin)
68
68
69 // verify titleLabel disappears and textLabel moves up
69 // verify titleLabel disappears and textLabel moves up
70 previewTextSummary.widgetData = widgetDataNoTitle
70 previewTextSummary.widgetData = widgetDataNoTitle
@@ -81,7 +81,7 @@ Rectangle {
81 previewTextSummary.widgetData = widgetDataShortText
81 previewTextSummary.widgetData = widgetDataShortText
82 verify(textLabel.lineCount <= textLabel.maximumCollapsedLineCount)
82 verify(textLabel.lineCount <= textLabel.maximumCollapsedLineCount)
83 tryCompare(textLabel, "height", textLabel.contentHeight)
83 tryCompare(textLabel, "height", textLabel.contentHeight)
84− tryCompare(previewTextSummary, "height", titleLabel.height + textLabel.height)
84+ tryCompare(previewTextSummary, "height", titleLabel.height + textLabel.height + textLabel.anchors.topMargin)
85 }
85 }
86 }
86 }
87}
87}