using native text
This commit is contained in:
parent
58b8bdbd31
commit
6c0bf60e07
2 changed files with 30 additions and 11 deletions
25
Content.qml
25
Content.qml
|
@ -13,7 +13,7 @@ ScrollView {
|
|||
}
|
||||
|
||||
Item {
|
||||
height: column.height + 20
|
||||
height: column.height + 50
|
||||
width: parent.parent.width
|
||||
|
||||
Rectangle {
|
||||
|
@ -42,23 +42,33 @@ ScrollView {
|
|||
}
|
||||
color: "gray"
|
||||
font.pointSize: 16
|
||||
wrapMode: Text.Wrap
|
||||
textFormat: Text.PlainText
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
width: parent.width
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Label {
|
||||
text: post ? post.title : ""
|
||||
font.pointSize: 30
|
||||
wrapMode: Text.Wrap
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
width: parent.width
|
||||
renderType: Text.NativeRendering
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: Qt.openUrlExternally(post.link)
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: post ? post.date.toLocaleString(Qt.locale(), Locale.LongFormat) : ""
|
||||
color: "gray"
|
||||
font.pointSize: 16
|
||||
wrapMode: Text.Wrap
|
||||
textFormat: Text.PlainText
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
width: parent.width
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
@ -88,14 +98,15 @@ ScrollView {
|
|||
|
||||
Label {
|
||||
id: contentLabel
|
||||
text: post ? post.content : ""
|
||||
text: post ? "<style>a { color: #555; }</style>" + post.content : ""
|
||||
textFormat: Text.RichText
|
||||
font.pointSize: 16
|
||||
wrapMode: Text.Wrap
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
width: parent.width
|
||||
renderType: Text.NativeRendering
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 20
|
||||
lineHeight: 1.3
|
||||
linkColor: "#555"
|
||||
onLinkActivated: {
|
||||
Qt.openUrlExternally(link)
|
||||
}
|
||||
|
|
|
@ -29,27 +29,35 @@ Component {
|
|||
Label {
|
||||
text: feedTitle
|
||||
font.pointSize: 12
|
||||
textFormat: Text.PlainText
|
||||
color: "gray"
|
||||
wrapMode: Text.Wrap
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
Label {
|
||||
text: date.toLocaleString(Qt.locale(), Locale.ShortFormat)
|
||||
font.pointSize: 12
|
||||
textFormat: Text.PlainText
|
||||
color: "gray"
|
||||
wrapMode: Text.Wrap
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
Label {
|
||||
text: title
|
||||
font.pointSize: 16
|
||||
wrapMode: Text.Wrap
|
||||
textFormat: Text.PlainText
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
renderType: Text.NativeRendering
|
||||
width: parent.width
|
||||
}
|
||||
Label {
|
||||
text: excerpt
|
||||
font.pointSize: 12
|
||||
textFormat: Text.PlainText
|
||||
color: "gray"
|
||||
wrapMode: Text.Wrap
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
renderType: Text.NativeRendering
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue