From 59c4894639a805b7e1229551448e7c7351050301 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Fri, 2 Jul 2021 16:06:32 +0200 Subject: [PATCH] Remove EpisodeSwipePage; only showing all episodes for now The "New Episodes" tab is to be replaced by a filter view button and dialog to be able to filter several episode statuses. I.e. new, played / not played, etc. --- src/qml/EpisodeListPage.qml | 14 +++--- src/qml/EpisodeSwipePage.qml | 83 ------------------------------------ src/qml/main.qml | 29 +++---------- src/resources.qrc | 1 - 4 files changed, 16 insertions(+), 111 deletions(-) delete mode 100644 src/qml/EpisodeSwipePage.qml diff --git a/src/qml/EpisodeListPage.qml b/src/qml/EpisodeListPage.qml index 09696946..77403744 100644 --- a/src/qml/EpisodeListPage.qml +++ b/src/qml/EpisodeListPage.qml @@ -15,6 +15,8 @@ import org.kde.kasts 1.0 Kirigami.ScrollablePage { + title: i18n("Episode List") + property var episodeType: EpisodeModel.All supportsRefreshing: true @@ -25,11 +27,13 @@ Kirigami.ScrollablePage { } } - actions.main: Kirigami.Action { - iconName: "view-refresh" - text: i18n("Refresh All Podcasts") - onTriggered: refreshing = true - visible: Kirigami.Settings.isMobile && episodeList.count === 0 + actions { + main: Kirigami.Action { + iconName: "view-refresh" + text: i18n("Refresh All Podcasts") + onTriggered: refreshing = true + visible: !Kirigami.Settings.isMobile || episodeList.count === 0 + } } Kirigami.PlaceholderMessage { diff --git a/src/qml/EpisodeSwipePage.qml b/src/qml/EpisodeSwipePage.qml deleted file mode 100644 index 7cc69e96..00000000 --- a/src/qml/EpisodeSwipePage.qml +++ /dev/null @@ -1,83 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2021 Bart De Vries - * - * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL - */ - -import QtQuick 2.14 -import QtQuick.Controls 2.14 as Controls -import QtQuick.Layouts 1.14 -import QtGraphicalEffects 1.15 -import org.kde.kirigami 2.15 as Kirigami - -import org.kde.kasts 1.0 - -Kirigami.Page { - id: page - - title: i18n("Episode List") - padding: 0 - - actions.main: Kirigami.Action { - iconName: "view-refresh" - text: i18n("Refresh All Podcasts") - visible: !Kirigami.Settings.isMobile - onTriggered: updateAllFeeds.run() - } - - header: Loader { - id: headerLoader - active: !Kirigami.Settings.isMobile - sourceComponent: tabBarComponent - } - - footer: Loader { - id: footerLoader - active: Kirigami.Settings.isMobile - sourceComponent: tabBarComponent - } - - Component { - id: tabBarComponent - Controls.TabBar { - id: tabBar - position: Kirigami.Settings.isMobile ? Controls.TabBar.Footer : Controls.TabBar.Header - currentIndex: swipeView.currentIndex - contentHeight: tabBarHeight - - Controls.TabButton { - width: parent.parent.width/parent.count - height: tabBarHeight - text: i18n("New Episodes") - } - Controls.TabButton { - width: parent.parent.width/parent.count - height: tabBarHeight - text: i18n("All Episodes") - } - } - } - - contentItem: Controls.SwipeView { - id: swipeView - - 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 { - title: i18n("New Episodes") - episodeType: EpisodeModel.New - } - - EpisodeListPage { - title: i18n("All Episodes") - episodeType: EpisodeModel.All - } - } -} diff --git a/src/qml/main.qml b/src/qml/main.qml index cf5efa57..63f594da 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -21,9 +21,7 @@ Kirigami.ApplicationWindow { minimumHeight: Kirigami.Units.gridUnit * 20 property var miniplayerSize: Kirigami.Units.gridUnit * 3 + Kirigami.Units.gridUnit / 6 - property int tabBarHeight: Kirigami.Units.gridUnit * 2 - property int bottomMessageSpacing: Kirigami.Settings.isMobile ? Kirigami.Units.largeSpacing * 9 + ( AudioManager.entry ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + tabBarActive * tabBarHeight : Kirigami.Units.largeSpacing * 2 - property int tabBarActive: 0 + property int bottomMessageSpacing: Kirigami.Settings.isMobile ? Kirigami.Units.largeSpacing * 9 + ( AudioManager.entry ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) : Kirigami.Units.largeSpacing * 2 property int originalWidth: Kirigami.Units.gridUnit * 10 property var lastFeed: "" property string currentPage: "" @@ -37,7 +35,7 @@ Kirigami.ApplicationWindow { function getPage(page) { switch (page) { case "QueuePage": return "qrc:/QueuePage.qml"; - case "EpisodeSwipePage": return "qrc:/EpisodeSwipePage.qml"; + case "EpisodeListPage": return "qrc:/EpisodeListPage.qml"; case "DiscoverPage": return "qrc:/DiscoverPage.qml"; case "FeedListPage": return "qrc:/FeedListPage.qml"; case "DownloadListPage": return "qrc:/DownloadListPage.qml"; @@ -53,12 +51,6 @@ Kirigami.ApplicationWindow { } Component.onCompleted: { - tabBarActive = SettingsManager.lastOpenedPage === "FeedListPage" ? 0 - : SettingsManager.lastOpenedPage === "QueuePage" ? 0 - : SettingsManager.lastOpenedPage === "EpisodeSwipePage" ? 1 - : SettingsManager.lastOpenedPage === "DownloadListPage" ? 0 - : SettingsManager.lastOpenedPage === "DiscoverPage" ? 0 - : 0 currentPage = SettingsManager.lastOpenedPage pageStack.initialPage = getPage(SettingsManager.lastOpenedPage) @@ -94,7 +86,7 @@ Kirigami.ApplicationWindow { } // make room at the bottom for miniplayer - handle.anchors.bottomMargin: (( AudioManager.entry && Kirigami.Settings.isMobile ) ? (footerLoader.item.contentY == 0 ? miniplayerSize : 0) : 0) + Kirigami.Units.smallSpacing + tabBarActive * tabBarHeight + handle.anchors.bottomMargin: (( AudioManager.entry && Kirigami.Settings.isMobile ) ? (footerLoader.item.contentY == 0 ? miniplayerSize : 0) : 0) + Kirigami.Units.smallSpacing handleVisible: Kirigami.Settings.isMobile ? !AudioManager.entry || footerLoader.item.contentY === 0 : false showHeaderWhenCollapsed: true actions: [ @@ -105,7 +97,6 @@ Kirigami.ApplicationWindow { onTriggered: { pushPage("QueuePage") SettingsManager.lastOpenedPage = "QueuePage" // for persistency - tabBarActive = 0 } }, Kirigami.Action { @@ -115,17 +106,15 @@ Kirigami.ApplicationWindow { onTriggered: { pushPage("DiscoverPage") SettingsManager.lastOpenedPage = "DiscoverPage" // for persistency - tabBarActive = 0 } }, Kirigami.Action { text: i18n("Episodes") iconName: "rss" - checked: currentPage == "EpisodeSwipePage" + checked: currentPage == "EpisodeListPage" onTriggered: { - pushPage("EpisodeSwipePage") - SettingsManager.lastOpenedPage = "EpisodeSwipePage" // for persistency - tabBarActive = 1 + pushPage("EpisodeListPage") + SettingsManager.lastOpenedPage = "EpisodeListPage" // for persistency } }, Kirigami.Action { @@ -135,7 +124,6 @@ Kirigami.ApplicationWindow { onTriggered: { pushPage("FeedListPage") SettingsManager.lastOpenedPage = "FeedListPage" // for persistency - tabBarActive = 0 } }, Kirigami.Action { @@ -145,7 +133,6 @@ Kirigami.ApplicationWindow { onTriggered: { pushPage("DownloadListPage") SettingsManager.lastOpenedPage = "DownloadListPage" // for persistency - tabBarActive = 0 } }, Kirigami.Action { @@ -154,7 +141,6 @@ Kirigami.ApplicationWindow { checked: currentPage == "SettingsPage" onTriggered: { pushPage("SettingsPage") - tabBarActive = 0 } }, Kirigami.Action { @@ -163,7 +149,6 @@ Kirigami.ApplicationWindow { checked: currentPage == "AboutPage" onTriggered: { pushPage("AboutPage") - tabBarActive = 0 } } ] @@ -191,7 +176,7 @@ Kirigami.ApplicationWindow { contextDrawer: Kirigami.ContextDrawer { id: contextDrawer // make room at the bottom for miniplayer - handle.anchors.bottomMargin: ( (AudioManager.entry && Kirigami.Settings.isMobile) ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + Kirigami.Units.smallSpacing + tabBarActive * tabBarHeight + handle.anchors.bottomMargin: ( (AudioManager.entry && Kirigami.Settings.isMobile) ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + Kirigami.Units.smallSpacing handleVisible: Kirigami.Settings.isMobile ? !AudioManager.entry || footerLoader.item.contentY === 0 : false } diff --git a/src/resources.qrc b/src/resources.qrc index 47d120cb..5d1ec7da 100755 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -18,7 +18,6 @@ qml/EpisodeListPage.qml qml/DownloadListPage.qml qml/ErrorListOverlay.qml - qml/EpisodeSwipePage.qml qml/GenericHeader.qml qml/GenericEntryDelegate.qml qml/DiscoverPage.qml