Make Entry and Feed details text selectable

This commit is contained in:
Bart De Vries 2021-10-02 20:39:15 +02:00
parent 157e1219bb
commit fdbe348f12
2 changed files with 38 additions and 10 deletions

View File

@ -73,9 +73,11 @@ Kirigami.ScrollablePage {
subtitle: entry.feed.name
}
Controls.Label {
TextEdit {
id: textLabel
Layout.margins: Kirigami.Units.gridUnit
readOnly: true
selectByMouse: true
text: page.entry.content
baseUrl: page.entry.baseUrl
textFormat: Text.RichText

View File

@ -44,37 +44,63 @@ Kirigami.ScrollablePage {
}
ColumnLayout {
Kirigami.Heading {
text: feed.description;
level: 3
TextEdit {
readOnly: true
selectByMouse: true
textFormat:TextEdit.RichText
text: feed.description
font.pointSize: Math.round(Kirigami.Theme.defaultFont.pointSize * 1.2)
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
Controls.Label {
TextEdit {
readOnly: true
selectByMouse: true
textFormat:TextEdit.RichText
text: i18nc("by <Author(s)>", "by %1", author)
visible: author !== ""
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
Controls.Label {
text: "<a href='%1'>%1</a>".arg(feed.link)
TextEdit {
readOnly: true
selectByMouse: true
textFormat:TextEdit.RichText
text: i18n("Podcast URL") + ": <a href='%1'>%1</a>".arg(feed.url)
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
TextEdit {
readOnly: true
selectByMouse: true
textFormat:TextEdit.RichText
text: i18n("Weblink") + ": <a href='%1'>%1</a>".arg(feed.link)
onLinkActivated: Qt.openUrlExternally(link)
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
Controls.Label {
TextEdit {
readOnly: true
selectByMouse: true
textFormat:TextEdit.RichText
text: isSubscribed ? i18n("Subscribed since: %1", feed.subscribed.toLocaleString(Qt.locale(), Locale.ShortFormat)) : ""
visible: isSubscribed
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
Controls.Label {
TextEdit {
readOnly: true
selectByMouse: true
textFormat:TextEdit.RichText
text: isSubscribed ? i18n("Last Updated: %1", feed.lastUpdated.toLocaleString(Qt.locale(), Locale.ShortFormat)) : ""
visible: isSubscribed
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
Controls.Label {
TextEdit {
readOnly: true
selectByMouse: true
textFormat:TextEdit.RichText
text: i18np("1 Episode", "%1 Episodes", feed.entryCount) + ", " + i18np("1 Unplayed", "%1 Unplayed", feed.unreadEntryCount)
visible: isSubscribed
wrapMode: Text.WordWrap