on xenial help sign in
Fix generic preview wrapping and force rich text parsing.
dc9fcf9Michał Sawicz
Dash/Generic/GenericPreview.qml+10−2
@@ -74,25 +74,33 @@ DashPreview {
74 spacing: units.gu(2)
74 spacing: units.gu(2)
75
75
76 Label {
76 Label {
77+ anchors { left: parent.left; right: parent.right }
77 visible: text != ""
78 visible: text != ""
78 fontSize: "medium"
79 fontSize: "medium"
79 opacity: 0.6
80 opacity: 0.6
80 color: "white"
81 color: "white"
81− text: previewData.subtitle
82+ text: previewData.subtitle.replace(/[\r\n]+/g, "<br />")
82 style: Text.Raised
83 style: Text.Raised
83 styleColor: "black"
84 styleColor: "black"
84 wrapMode: Text.WordWrap
85 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 }
85 }
89 }
86
90
87 Label {
91 Label {
92+ anchors { left: parent.left; right: parent.right }
88 visible: text != ""
93 visible: text != ""
89 fontSize: "small"
94 fontSize: "small"
90 opacity: 0.6
95 opacity: 0.6
91 color: "white"
96 color: "white"
92− text: previewData.description
97+ text: previewData.description.replace(/[\r\n]+/g, "<br />")
93 style: Text.Raised
98 style: Text.Raised
94 styleColor: "black"
99 styleColor: "black"
95 wrapMode: Text.WordWrap
100 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 }
96 }
104 }
97 }
105 }
98}
106}