Skip to content

Commit

Permalink
redo the post link
Browse files Browse the repository at this point in the history
- strip the post link from excerpt
- redo link with proper style
- put link on bottom
- clip excerpt before the link
  • Loading branch information
illwieckz committed Aug 28, 2019
1 parent 9183345 commit c2382cd
Showing 1 changed file with 43 additions and 6 deletions.
49 changes: 43 additions & 6 deletions NewsCard.qml
Original file line number Diff line number Diff line change
Expand Up @@ -114,38 +114,75 @@ Flickable {
}

width: parent.width - 15
height: parent.height - 15
height: parent.height - 15 - 30

clip: true
color: "transparent"

Column {
id: column
id: excerptColumn

width: parent.width
height: parent.height
spacing: Units.smallSpacing * 2

TitleLabel {
id: title

text: item.cardTitle

clip: true
font.pixelSize: 30
font.bold: true
}

BodyLabel {
id: summary

width: parent.width

width: parent.width
wrapMode: Text.WordWrap
text: item.summary

text: item.summary.substring(0, item.summary.search("<a"))
textFormat: Text.RichText

font.pixelSize: 21
lineHeight: 24
color: "lightgrey"
}
}
}

Rectangle {
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}

width: parent.width - 15
height: 30

clip: true
color: "transparent"

Column {
id: linkColumn

width: parent.width
height: parent.height
spacing: Units.smallSpacing * 2

BodyLabel {
id: link

width: parent.width

text: "<p style='text-align: right;'><a style='color:#00B2B8;' href='" + item.url + "'>&rarr; Continue reading</a></p>"
textFormat: Text.RichText

font.pixelSize: 21
lineHeight: 24

onLinkActivated: {
onLinkActivated: {
Qt.openUrlExternally(link);
}

Expand Down

0 comments on commit c2382cd

Please sign in to comment.