From eec54d309558c0971cccd8c185fad64e16152313 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Mon, 31 May 2021 10:40:05 +0200 Subject: [PATCH] Move feed update action to header on desktop The refresh buttons currently show up as main action buttons at the bottom on desktop since they are placed inside SwipeViews/tabs. Move these actions to the hierarchical parent ScrollablePages so they end up in the header bar. --- src/qml/DownloadSwipePage.qml | 18 ++++++++++++++++-- src/qml/EpisodeListPage.qml | 2 +- src/qml/EpisodeSwipePage.qml | 18 ++++++++++++++++-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/qml/DownloadSwipePage.qml b/src/qml/DownloadSwipePage.qml index 09618abf..4b363c87 100644 --- a/src/qml/DownloadSwipePage.qml +++ b/src/qml/DownloadSwipePage.qml @@ -19,6 +19,13 @@ Kirigami.Page { title: i18n("Downloads") padding: 0 + actions.main: Kirigami.Action { + iconName: "view-refresh" + text: i18n("Refresh All Podcasts") + visible: !Kirigami.Settings.isMobile + onTriggered: Fetcher.fetchAll() + } + header: Loader { id: headerLoader active: !Kirigami.Settings.isMobile @@ -57,9 +64,16 @@ Kirigami.Page { } } - Controls.SwipeView { + contentItem: Controls.SwipeView { id: swipeView - anchors.fill: parent + + anchors { + top: page.header.bottom + right: page.right + left: page.left + bottom: page.footer.top + } + currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex EpisodeListPage { diff --git a/src/qml/EpisodeListPage.qml b/src/qml/EpisodeListPage.qml index 679d4c52..b7df9fd0 100644 --- a/src/qml/EpisodeListPage.qml +++ b/src/qml/EpisodeListPage.qml @@ -30,7 +30,7 @@ Kirigami.ScrollablePage { iconName: "view-refresh" text: i18n("Refresh All Podcasts") onTriggered: refreshing = true - visible: !Kirigami.Settings.isMobile || episodeList.count === 0 + visible: Kirigami.Settings.isMobile && episodeList.count === 0 } Kirigami.PlaceholderMessage { diff --git a/src/qml/EpisodeSwipePage.qml b/src/qml/EpisodeSwipePage.qml index b54ee2e5..c9f30f39 100644 --- a/src/qml/EpisodeSwipePage.qml +++ b/src/qml/EpisodeSwipePage.qml @@ -19,6 +19,13 @@ Kirigami.Page { title: i18n("Episode List") padding: 0 + actions.main: Kirigami.Action { + iconName: "view-refresh" + text: i18n("Refresh All Podcasts") + visible: !Kirigami.Settings.isMobile + onTriggered: Fetcher.fetchAll() + } + header: Loader { id: headerLoader active: !Kirigami.Settings.isMobile @@ -52,9 +59,16 @@ Kirigami.Page { } } - Controls.SwipeView { + contentItem: Controls.SwipeView { id: swipeView - anchors.fill: parent + + anchors { + top: page.header.bottom + right: page.right + left: page.left + bottom: page.footer.top + } + currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex EpisodeListPage {