diff --git a/src/qml/DownloadListPage.qml b/src/qml/DownloadListPage.qml index 6b944340..b7fb37db 100644 --- a/src/qml/DownloadListPage.qml +++ b/src/qml/DownloadListPage.qml @@ -34,31 +34,29 @@ Kirigami.ScrollablePage { contextualActions: episodeList.defaultActionList - Kirigami.PlaceholderMessage { - visible: episodeList.count === 0 - - width: Kirigami.Units.gridUnit * 20 - anchors.centerIn: parent - - text: i18n("No Downloads") - } - - Component { - id: episodeListDelegate - GenericEntryDelegate { - listView: episodeList - isDownloads: true - } - } - GenericEntryListView { id: episodeList - visible: count !== 0 isDownloads: true reuseItems: true + Kirigami.PlaceholderMessage { + visible: episodeList.count === 0 + + width: Kirigami.Units.gridUnit * 20 + anchors.centerIn: parent + + text: i18n("No Downloads") + } + model: DownloadModel - delegate: episodeListDelegate + + delegate: Component { + id: episodeListDelegate + GenericEntryDelegate { + listView: episodeList + isDownloads: true + } + } section { delegate: Kirigami.ListSectionHeader { diff --git a/src/qml/EpisodeListPage.qml b/src/qml/EpisodeListPage.qml index cb236300..840456e6 100644 --- a/src/qml/EpisodeListPage.qml +++ b/src/qml/EpisodeListPage.qml @@ -14,7 +14,7 @@ import org.kde.kirigami 2.19 as Kirigami import org.kde.kasts 1.0 Kirigami.ScrollablePage { - + id: episodeListPage title: i18n("Episode List") LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft @@ -51,6 +51,63 @@ Kirigami.ScrollablePage { visible: episodeProxyModel.filterType == EpisodeProxyModel.NoFilter } + contextualActions: episodeList.defaultActionList + + GenericEntryListView { + id: episodeList + anchors.fill: parent + reuseItems: true + + Kirigami.PlaceholderMessage { + visible: episodeList.count === 0 + + width: Kirigami.Units.gridUnit * 20 + anchors.centerIn: parent + + text: i18n("No Episodes Available") + } + + + + model: EpisodeProxyModel { + id: episodeProxyModel + } + + delegate: Component { + id: episodeListDelegate + GenericEntryDelegate { + listView: episodeList + } + } + + Kirigami.InlineMessage { + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + margins: Kirigami.Units.largeSpacing + bottomMargin: Kirigami.Units.largeSpacing + ( errorNotification.visible ? errorNotification.height + Kirigami.Units.largeSpacing : 0 ) + ( updateNotification.visible ? updateNotification.height + Kirigami.Units.largeSpacing : 0 ) + ( updateSyncNotification.visible ? updateSyncNotification.height + Kirigami.Units.largeSpacing : 0 ) + } + type: Kirigami.MessageType.Information + visible: episodeProxyModel.filterType != EpisodeProxyModel.NoFilter + text: textMetrics.text + width: Math.min(textMetrics.width + 2 * Kirigami.Units.largeSpacing + 10 * Kirigami.Units.gridUnit, parent.width - anchors.leftMargin - anchors.rightMargin) + actions: [ + Kirigami.Action { + id: resetButton + icon.name: "edit-delete-remove" + text: i18n("Reset") + onTriggered: { + episodeProxyModel.filterType = EpisodeProxyModel.NoFilter; + } + } + ] + TextMetrics { + id: textMetrics + text: i18n("Filter Active: ") + episodeProxyModel.filterName + } + } + } + Kirigami.Dialog { id: filterTypeOverlay @@ -90,64 +147,4 @@ Kirigami.ScrollablePage { } } } - - Kirigami.InlineMessage { - z: 2 - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - margins: Kirigami.Units.largeSpacing - bottomMargin: Kirigami.Units.largeSpacing + ( errorNotification.visible ? errorNotification.height + Kirigami.Units.largeSpacing : 0 ) + ( updateNotification.visible ? updateNotification.height + Kirigami.Units.largeSpacing : 0 ) + ( updateSyncNotification.visible ? updateSyncNotification.height + Kirigami.Units.largeSpacing : 0 ) - } - type: Kirigami.MessageType.Information - visible: episodeProxyModel.filterType != EpisodeProxyModel.NoFilter - TextMetrics { - id: textMetrics - text: i18n("Filter Active: ") + episodeProxyModel.filterName - } - text: textMetrics.text - width: Math.min(textMetrics.width + 2 * Kirigami.Units.largeSpacing + 10 * Kirigami.Units.gridUnit, parent.width - anchors.leftMargin - anchors.rightMargin) - actions: [ - Kirigami.Action { - id: resetButton - icon.name: "edit-delete-remove" - text: i18n("Reset") - onTriggered: { - episodeProxyModel.filterType = EpisodeProxyModel.NoFilter; - } - } - ] - } - - contextualActions: episodeList.defaultActionList - - Kirigami.PlaceholderMessage { - visible: episodeList.count === 0 - - width: Kirigami.Units.gridUnit * 20 - anchors.centerIn: parent - - text: i18n("No Episodes Available") - } - - Component { - id: episodeListDelegate - GenericEntryDelegate { - listView: episodeList - } - } - - EpisodeProxyModel { - id: episodeProxyModel - } - - GenericEntryListView { - id: episodeList - anchors.fill: parent - visible: count !== 0 - reuseItems: true - - model: episodeProxyModel - delegate: episodeListDelegate - } } diff --git a/src/qml/FeedDetailsPage.qml b/src/qml/FeedDetailsPage.qml index b2c9127b..03c69b5a 100644 --- a/src/qml/FeedDetailsPage.qml +++ b/src/qml/FeedDetailsPage.qml @@ -80,7 +80,6 @@ Kirigami.ScrollablePage { GenericEntryListView { id: entryList - visible: true reuseItems: true currentIndex: -1 diff --git a/src/qml/GenericEntryListView.qml b/src/qml/GenericEntryListView.qml index 4e1a71b9..a73e2786 100644 --- a/src/qml/GenericEntryListView.qml +++ b/src/qml/GenericEntryListView.qml @@ -15,7 +15,6 @@ import org.kde.kasts 1.0 ListView { id: listView - visible: count !== 0 clip: true property bool isQueue: false property bool isDownloads: false diff --git a/src/qml/QueuePage.qml b/src/qml/QueuePage.qml index 078495fa..c9969636 100644 --- a/src/qml/QueuePage.qml +++ b/src/qml/QueuePage.qml @@ -40,29 +40,20 @@ Kirigami.ScrollablePage { contextualActions: queueList.defaultActionList - Kirigami.PlaceholderMessage { - visible: queueList.count === 0 - - width: Kirigami.Units.gridUnit * 20 - anchors.centerIn: parent - - text: i18nc("@info", "Queue is empty") - } - - Component { - id: delegateComponent - GenericEntryDelegate { - isQueue: true - listView: queueList - } - } - GenericEntryListView { id: queueList isQueue: true - visible: count !== 0 anchors.fill: parent + Kirigami.PlaceholderMessage { + visible: queueList.count === 0 + + width: Kirigami.Units.gridUnit * 20 + anchors.centerIn: parent + + text: i18nc("@info", "Queue is empty") + } + header: ColumnLayout { anchors.right: parent.right anchors.left: parent.left @@ -80,6 +71,14 @@ Kirigami.ScrollablePage { id: queueModel } + Component { + id: delegateComponent + GenericEntryDelegate { + isQueue: true + listView: queueList + } + } + delegate: Kirigami.DelegateRecycler { width: queueList.width sourceComponent: delegateComponent