diff --git a/package/contents/config/main.xml b/package/contents/config/main.xml index 287623a..a2ba666 100644 --- a/package/contents/config/main.xml +++ b/package/contents/config/main.xml @@ -29,6 +29,9 @@ true + + false + true diff --git a/package/contents/ui/ConfigGeneral.qml b/package/contents/ui/ConfigGeneral.qml index f447572..f2e8360 100644 --- a/package/contents/ui/ConfigGeneral.qml +++ b/package/contents/ui/ConfigGeneral.qml @@ -12,6 +12,7 @@ Kirigami.FormLayout { property alias cfg_itemsDownloadLimit: itemsDownloadLimit.value property alias cfg_autoRead: autoRead.checked property alias cfg_fetchUnreadOnly: fetchUnreadOnly.checked + property alias cfg_readAndFetch: readAndFetch.checked signal configurationChanged @@ -78,6 +79,11 @@ Kirigami.FormLayout { Kirigami.FormData.label: i18n("Fetch unread only") } + CheckBox { + id: readAndFetch + Kirigami.FormData.label: i18n("Fetch articles after 'Read all'") + } + CheckBox { id: autoRead Kirigami.FormData.label: i18n("Automatically mark an article as read") diff --git a/package/contents/ui/InoreaderModel.qml b/package/contents/ui/InoreaderModel.qml index 7e925cd..c268454 100644 --- a/package/contents/ui/InoreaderModel.qml +++ b/package/contents/ui/InoreaderModel.qml @@ -16,6 +16,8 @@ BaseObject { readonly property int unreadCount: Math.max(_.unreadCount, 0) readonly property string unreadCountFormatted: _.kNumber(unreadCount) + (_.unreadMaxReached ? "+" : "") + signal reloaded() + Connections { target: dispatcher @@ -25,6 +27,7 @@ BaseObject { onSetArticleRead: _.setArticleRead(article, read) onSetAllArticlesRead: _.setAllArticlesRead(read) + onSetAllArticlesReadAndFetch: _.callPending(() => _.setAllArticlesRead(read).then(_.loadData), 'fetchStream') onSetArticleStarred: _.setArticleStarred(article, starred) } @@ -110,6 +113,7 @@ BaseObject { if (!continuation) { _.articles.clear() + reloaded() } _.articles.append(stream.items) _.unreadNewCount = 0 diff --git a/package/contents/ui/Logic.qml b/package/contents/ui/Logic.qml index 1f92489..f663741 100644 --- a/package/contents/ui/Logic.qml +++ b/package/contents/ui/Logic.qml @@ -10,6 +10,7 @@ QtObject { signal fetchStreamContinuation() signal setAllArticlesRead(bool read) + signal setAllArticlesReadAndFetch(bool read) signal setArticleRead(var article, bool read) signal setArticleStarred(var article, bool starred) @@ -52,7 +53,13 @@ QtObject { icon.name: "checkbox" text: i18n("Read all") onTriggered: setAllArticlesRead(true) - } + } + + readonly property Action readAllAndFetchAction: Action { + icon.name: "checkbox" + text: i18n("Read all and fetch") + onTriggered: setAllArticlesReadAndFetch(true) + } readonly property Action starAction: Action { readonly property var icons: ({ false: "non-starred-symbolic", true: "starred-symbolic" }) diff --git a/package/contents/ui/StreamView.qml b/package/contents/ui/StreamView.qml index 4e9fbd6..079099c 100644 --- a/package/contents/ui/StreamView.qml +++ b/package/contents/ui/StreamView.qml @@ -54,7 +54,7 @@ FocusScope { Layout.fillWidth: true } ToolButton { - action: logic.readAllAction + action: plasmoid.configuration.readAndFetch ? logic.readAllAndFetchAction : logic.readAllAction } ToolButton { action: logic.reloadAction @@ -100,6 +100,10 @@ FocusScope { } property bool isCurrentItem: GridView.isCurrentItem } + Connections { + target: stream + onReloaded: Qt.callLater(listView.positionViewAtBeginning) + } } } }