on xenial help sign in
Fix generic preview wrapping and force rich text parsing.

Approved by PS Jenkins bot, Albert Astals Cid.

commitdc9fcf92d1f3e83e1a8de27225178556f7149817 authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 16 Aug 2013, 16:26 (13 years ago) parent2f7359998f0260
1 file changed+10−2
Dash/Generic/GenericPreview.qml+10−2
Dash/Generic/GenericPreview.qml+10−2
@@ -74,25 +74,33 @@ DashPreview {
7474 spacing: units.gu(2)
7575
7676 Label {
77+ anchors { left: parent.left; right: parent.right }
7778 visible: text != ""
7879 fontSize: "medium"
7980 opacity: 0.6
8081 color: "white"
81− text: previewData.subtitle
82+ text: previewData.subtitle.replace(/[\r\n]+/g, "<br />")
8283 style: Text.Raised
8384 styleColor: "black"
8485 wrapMode: Text.WordWrap
86+ textFormat: Text.RichText
87+ // FIXME: workaround for https://bugreports.qt-project.org/browse/QTBUG-33020
88+ onWidthChanged: { wrapMode = Text.NoWrap; wrapMode = Text.WordWrap }
8589 }
8690
8791 Label {
92+ anchors { left: parent.left; right: parent.right }
8893 visible: text != ""
8994 fontSize: "small"
9095 opacity: 0.6
9196 color: "white"
92− text: previewData.description
97+ text: previewData.description.replace(/[\r\n]+/g, "<br />")
9398 style: Text.Raised
9499 styleColor: "black"
95100 wrapMode: Text.WordWrap
101+ textFormat: Text.RichText
102+ // FIXME: workaround for https://bugreports.qt-project.org/browse/QTBUG-33020
103+ onWidthChanged: { wrapMode = Text.NoWrap; wrapMode = Text.WordWrap }
96104 }
97105 }
98106}