mirror of https://github.com/KDE/kasts.git
First attempt at Swipeable episode list (all, new, unread)
This commit is contained in:
parent
e92b02795e
commit
29d625e810
|
@ -19,6 +19,7 @@ public:
|
|||
enum Type {
|
||||
All,
|
||||
New,
|
||||
Unread,
|
||||
Downloading,
|
||||
Downloaded,
|
||||
};
|
||||
|
|
|
@ -10,14 +10,16 @@ import QtQuick.Controls 2.14 as Controls
|
|||
import QtQuick.Layouts 1.14
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtMultimedia 5.15
|
||||
import org.kde.kirigami 2.12 as Kirigami
|
||||
import org.kde.kirigami 2.15 as Kirigami
|
||||
|
||||
import org.kde.alligator 1.0
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
id: page
|
||||
|
||||
title: i18n("Episode List")
|
||||
Kirigami.ScrollablePage {
|
||||
//anchors.fill: parent
|
||||
|
||||
title: i18n("New Episodes")
|
||||
property var episodeType: EpisodeModel.All
|
||||
|
||||
supportsRefreshing: true
|
||||
onRefreshingChanged: {
|
||||
|
@ -27,13 +29,6 @@ Kirigami.ScrollablePage {
|
|||
}
|
||||
}
|
||||
|
||||
actions.main: Kirigami.Action {
|
||||
text: i18n("Refresh all feeds")
|
||||
iconName: "view-refresh"
|
||||
onTriggered: refreshing = true
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
}
|
||||
|
||||
Kirigami.PlaceholderMessage {
|
||||
visible: episodeList.count === 0
|
||||
|
||||
|
@ -42,22 +37,21 @@ Kirigami.ScrollablePage {
|
|||
|
||||
text: i18n("No Entries available")
|
||||
}
|
||||
|
||||
Component {
|
||||
id: entryListDelegate
|
||||
id: episodeListDelegate
|
||||
GenericEntryDelegate {
|
||||
listView: episodeList
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
anchors.fill: parent
|
||||
id: episodeList
|
||||
visible: count !== 0
|
||||
model: EpisodeModel { type: EpisodeModel.All }
|
||||
model: EpisodeModel { type: episodeType }
|
||||
|
||||
delegate: Kirigami.DelegateRecycler {
|
||||
width: episodeList.width
|
||||
sourceComponent: entryListDelegate
|
||||
sourceComponent: episodeListDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>
|
||||
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
|
||||
*
|
||||
* 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 QtMultimedia 5.15
|
||||
import org.kde.kirigami 2.15 as Kirigami
|
||||
|
||||
import org.kde.alligator 1.0
|
||||
|
||||
Kirigami.Page {
|
||||
id: page
|
||||
|
||||
title: i18n("Episode List")
|
||||
padding: 0
|
||||
|
||||
header: Controls.TabBar {
|
||||
id: tabBar
|
||||
currentIndex: swipeView.currentIndex
|
||||
|
||||
Controls.TabButton {
|
||||
text: "New Episodes"
|
||||
}
|
||||
Controls.TabButton {
|
||||
text: "All Episodes"
|
||||
}
|
||||
}
|
||||
|
||||
Controls.SwipeView {
|
||||
id: swipeView
|
||||
anchors.fill: parent
|
||||
currentIndex: tabBar.currentIndex
|
||||
|
||||
EpisodeListPage {
|
||||
title: i18n("New Episodes")
|
||||
episodeType: EpisodeModel.New
|
||||
}
|
||||
|
||||
EpisodeListPage {
|
||||
title: i18n("All Episodes")
|
||||
episodeType: EpisodeModel.All
|
||||
}
|
||||
}
|
||||
|
||||
/*actions.main: Kirigami.Action {
|
||||
text: i18n("Refresh all feeds")
|
||||
iconName: "view-refresh"
|
||||
onTriggered: refreshing = true
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
}*/
|
||||
}
|
|
@ -27,7 +27,7 @@ Kirigami.ApplicationWindow {
|
|||
|
||||
pageStack.initialPage: mainPagePool.loadPage(SettingsManager.lastOpenedPage === "FeedListPage" ? "qrc:/FeedListPage.qml"
|
||||
: SettingsManager.lastOpenedPage === "QueuePage" ? "qrc:/QueuePage.qml"
|
||||
: SettingsManager.lastOpenedPage === "EpisodeListPage" ? "qrc:/EpisodeListPage.qml"
|
||||
: SettingsManager.lastOpenedPage === "EpisodeSwipePage" ? "qrc:/EpisodeSwipePage.qml"
|
||||
: "qrc:/FeedListPage.qml")
|
||||
|
||||
globalDrawer: Kirigami.GlobalDrawer {
|
||||
|
@ -49,9 +49,9 @@ Kirigami.ApplicationWindow {
|
|||
text: i18n("Episodes")
|
||||
iconName: "rss"
|
||||
pagePool: mainPagePool
|
||||
page: "qrc:/EpisodeListPage.qml"
|
||||
page: "qrc:/EpisodeSwipePage.qml"
|
||||
onTriggered: {
|
||||
SettingsManager.lastOpenedPage = "EpisodeListPage" // for persistency
|
||||
SettingsManager.lastOpenedPage = "EpisodeSwipePage" // for persistency
|
||||
}
|
||||
},
|
||||
Kirigami.PagePoolAction {
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<file alias="FooterBar.qml">qml/FooterBar.qml</file>
|
||||
<file alias="QueuePage.qml">qml/QueuePage.qml</file>
|
||||
<file alias="EpisodeListPage.qml">qml/EpisodeListPage.qml</file>
|
||||
<file alias="EpisodeSwipePage.qml">qml/EpisodeSwipePage.qml</file>
|
||||
<file alias="GenericListHeader.qml">qml/GenericListHeader.qml</file>
|
||||
<file alias="GenericEntryDelegate.qml">qml/GenericEntryDelegate.qml</file>
|
||||
<file alias="logo.png">../logo.png</file>
|
||||
|
|
Loading…
Reference in New Issue