mirror of https://github.com/KDE/kasts.git
Port FeedListDelegate to BasicListItem
This commit is contained in:
parent
c8dea42485
commit
6c02f118e6
|
@ -116,6 +116,7 @@ void Entry::setRead(bool read)
|
|||
query.bindValue(QStringLiteral(":feed"), m_feed->url());
|
||||
query.bindValue(QStringLiteral(":read"), m_read);
|
||||
Database::instance().execute(query);
|
||||
Q_EMIT m_feed->unreadEntryCountChanged();
|
||||
}
|
||||
|
||||
QString Entry::adjustedContent(int width, int fontSize)
|
||||
|
|
|
@ -27,18 +27,18 @@ import org.kde.kirigami 2.12 as Kirigami
|
|||
import org.kde.alligator 1.0
|
||||
|
||||
Kirigami.SwipeListItem {
|
||||
height: Kirigami.Units.gridUnit*2
|
||||
|
||||
Item {
|
||||
FeedImage {
|
||||
id: image
|
||||
feed: model.feed
|
||||
}
|
||||
Controls.Label {
|
||||
text: model.feed.name
|
||||
height: parent.height
|
||||
anchors.left: image.right
|
||||
leftPadding: 0.5*Kirigami.Units.gridUnit
|
||||
contentItem: Kirigami.BasicListItem {
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
text: model.feed.name
|
||||
icon: model.feed.refreshing ? "view-refresh" : model.feed.image === "" ? "rss" : model.feed.image
|
||||
subtitle: i18np("%1 unread entry", "%1 unread entries", model.feed.unreadEntryCount)
|
||||
|
||||
|
||||
onClicked: {
|
||||
lastFeed = model.feed.url
|
||||
pageStack.push("qrc:/EntryListPage.qml", {"feed": model.feed})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,4 @@ Kirigami.SwipeListItem {
|
|||
|
||||
]
|
||||
|
||||
onClicked: {
|
||||
lastFeed = model.feed.url
|
||||
pageStack.push("qrc:/EntryListPage.qml", {"feed": model.feed})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue