mirror of https://github.com/KDE/kasts.git
Port EntryListDelegate to BasicListItem
This commit is contained in:
parent
6c02f118e6
commit
5fa40d89d9
|
@ -27,31 +27,27 @@ import org.kde.kirigami 2.12 as Kirigami
|
||||||
import org.kde.alligator 1.0
|
import org.kde.alligator 1.0
|
||||||
|
|
||||||
Kirigami.SwipeListItem {
|
Kirigami.SwipeListItem {
|
||||||
ColumnLayout {
|
|
||||||
spacing: 0
|
contentItem: Kirigami.BasicListItem {
|
||||||
Layout.fillWidth: true
|
anchors.top: parent.top
|
||||||
Layout.alignment: Qt.AlignVCenter
|
anchors.bottom: parent.bottom
|
||||||
Controls.Label {
|
anchors.left: parent.left
|
||||||
text: model.entry.title
|
text: model.entry.title
|
||||||
Layout.fillWidth: true
|
subtitle: model.entry.updated.toLocaleString(Qt.locale(), Locale.ShortFormat) + (model.entry.authors.length === 0 ? "" : " " + i18nc("by <author(s)>", "by") + " " + model.entry.authors[0].name)
|
||||||
elide: Text.ElideRight
|
reserveSpaceForIcon: false
|
||||||
opacity: 1
|
bold: !model.entry.read
|
||||||
color: model.entry.read ? Kirigami.Theme.disabledTextColor : Kirigami.Theme.textColor
|
|
||||||
}
|
|
||||||
Controls.Label {
|
|
||||||
id: subtitleItem
|
|
||||||
text: model.entry.updated.toLocaleString(Qt.locale(), Locale.ShortFormat) + (model.entry.authors.length === 0 ? "" : " " + i18nc("by <author(s)>", "by") + " " + model.entry.authors[0].name)
|
|
||||||
Layout.fillWidth: true
|
|
||||||
elide: Text.ElideRight
|
|
||||||
font: Kirigami.Theme.smallFont
|
|
||||||
opacity: 0.6
|
|
||||||
visible: text.length > 0
|
|
||||||
color: model.entry.read ? Kirigami.Theme.disabledTextColor : Kirigami.Theme.textColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
model.entry.read = true
|
model.entry.read = true
|
||||||
pageStack.push("qrc:/EntryPage.qml", {"entry": model.entry})
|
pageStack.push("qrc:/EntryPage.qml", {"entry": model.entry})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actions: [
|
||||||
|
Kirigami.Action {
|
||||||
|
text: i18n("Open in Browser")
|
||||||
|
icon.name: "globe"
|
||||||
|
onTriggered: Qt.openUrlExternally(model.entry.link)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue