using native text

This commit is contained in:
Jeena 2015-02-04 01:26:25 +01:00
parent 58b8bdbd31
commit 6c0bf60e07
2 changed files with 30 additions and 11 deletions

View file

@ -13,7 +13,7 @@ ScrollView {
} }
Item { Item {
height: column.height + 20 height: column.height + 50
width: parent.parent.width width: parent.parent.width
Rectangle { Rectangle {
@ -42,23 +42,33 @@ ScrollView {
} }
color: "gray" color: "gray"
font.pointSize: 16 font.pointSize: 16
wrapMode: Text.Wrap textFormat: Text.PlainText
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width width: parent.width
renderType: Text.NativeRendering
} }
Label { Label {
text: post ? post.title : "" text: post ? post.title : ""
font.pointSize: 30 font.pointSize: 30
wrapMode: Text.Wrap wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width width: parent.width
renderType: Text.NativeRendering
MouseArea {
anchors.fill: parent
onClicked: Qt.openUrlExternally(post.link)
}
} }
Label { Label {
text: post ? post.date.toLocaleString(Qt.locale(), Locale.LongFormat) : "" text: post ? post.date.toLocaleString(Qt.locale(), Locale.LongFormat) : ""
color: "gray" color: "gray"
font.pointSize: 16 font.pointSize: 16
wrapMode: Text.Wrap textFormat: Text.PlainText
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width width: parent.width
renderType: Text.NativeRendering
} }
Rectangle { Rectangle {
@ -88,14 +98,15 @@ ScrollView {
Label { Label {
id: contentLabel id: contentLabel
text: post ? post.content : "" text: post ? "<style>a { color: #555; }</style>" + post.content : ""
textFormat: Text.RichText
font.pointSize: 16 font.pointSize: 16
wrapMode: Text.Wrap wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width width: parent.width
renderType: Text.NativeRendering
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 20 anchors.topMargin: 20
lineHeight: 1.3 lineHeight: 1.3
linkColor: "#555"
onLinkActivated: { onLinkActivated: {
Qt.openUrlExternally(link) Qt.openUrlExternally(link)
} }

View file

@ -29,27 +29,35 @@ Component {
Label { Label {
text: feedTitle text: feedTitle
font.pointSize: 12 font.pointSize: 12
textFormat: Text.PlainText
color: "gray" color: "gray"
wrapMode: Text.Wrap wrapMode: Text.WrapAtWordBoundaryOrAnywhere
renderType: Text.NativeRendering
} }
Label { Label {
text: date.toLocaleString(Qt.locale(), Locale.ShortFormat) text: date.toLocaleString(Qt.locale(), Locale.ShortFormat)
font.pointSize: 12 font.pointSize: 12
textFormat: Text.PlainText
color: "gray" color: "gray"
wrapMode: Text.Wrap wrapMode: Text.WrapAtWordBoundaryOrAnywhere
renderType: Text.NativeRendering
} }
} }
Label { Label {
text: title text: title
font.pointSize: 16 font.pointSize: 16
wrapMode: Text.Wrap textFormat: Text.PlainText
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
renderType: Text.NativeRendering
width: parent.width width: parent.width
} }
Label { Label {
text: excerpt text: excerpt
font.pointSize: 12 font.pointSize: 12
textFormat: Text.PlainText
color: "gray" color: "gray"
wrapMode: Text.Wrap wrapMode: Text.WrapAtWordBoundaryOrAnywhere
renderType: Text.NativeRendering
width: parent.width width: parent.width
} }
} }