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(":feed"), m_feed->url());
|
||||||
query.bindValue(QStringLiteral(":read"), m_read);
|
query.bindValue(QStringLiteral(":read"), m_read);
|
||||||
Database::instance().execute(query);
|
Database::instance().execute(query);
|
||||||
|
Q_EMIT m_feed->unreadEntryCountChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Entry::adjustedContent(int width, int fontSize)
|
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
|
import org.kde.alligator 1.0
|
||||||
|
|
||||||
Kirigami.SwipeListItem {
|
Kirigami.SwipeListItem {
|
||||||
height: Kirigami.Units.gridUnit*2
|
|
||||||
|
|
||||||
Item {
|
contentItem: Kirigami.BasicListItem {
|
||||||
FeedImage {
|
anchors.top: parent.top
|
||||||
id: image
|
anchors.bottom: parent.bottom
|
||||||
feed: model.feed
|
|
||||||
}
|
|
||||||
Controls.Label {
|
|
||||||
text: model.feed.name
|
text: model.feed.name
|
||||||
height: parent.height
|
icon: model.feed.refreshing ? "view-refresh" : model.feed.image === "" ? "rss" : model.feed.image
|
||||||
anchors.left: image.right
|
subtitle: i18np("%1 unread entry", "%1 unread entries", model.feed.unreadEntryCount)
|
||||||
leftPadding: 0.5*Kirigami.Units.gridUnit
|
|
||||||
|
|
||||||
|
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