mirror of https://github.com/KDE/kasts.git
Solve issue of filter InlineMessages not showing up
This commit is contained in:
parent
9ead23ff59
commit
db41655c5f
|
@ -34,31 +34,29 @@ Kirigami.ScrollablePage {
|
||||||
|
|
||||||
contextualActions: episodeList.defaultActionList
|
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 {
|
GenericEntryListView {
|
||||||
id: episodeList
|
id: episodeList
|
||||||
visible: count !== 0
|
|
||||||
isDownloads: true
|
isDownloads: true
|
||||||
reuseItems: true
|
reuseItems: true
|
||||||
|
|
||||||
|
Kirigami.PlaceholderMessage {
|
||||||
|
visible: episodeList.count === 0
|
||||||
|
|
||||||
|
width: Kirigami.Units.gridUnit * 20
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
text: i18n("No Downloads")
|
||||||
|
}
|
||||||
|
|
||||||
model: DownloadModel
|
model: DownloadModel
|
||||||
delegate: episodeListDelegate
|
|
||||||
|
delegate: Component {
|
||||||
|
id: episodeListDelegate
|
||||||
|
GenericEntryDelegate {
|
||||||
|
listView: episodeList
|
||||||
|
isDownloads: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
delegate: Kirigami.ListSectionHeader {
|
delegate: Kirigami.ListSectionHeader {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.kde.kirigami 2.19 as Kirigami
|
||||||
import org.kde.kasts 1.0
|
import org.kde.kasts 1.0
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
Kirigami.ScrollablePage {
|
||||||
|
id: episodeListPage
|
||||||
title: i18n("Episode List")
|
title: i18n("Episode List")
|
||||||
|
|
||||||
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
|
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
|
||||||
|
@ -51,6 +51,63 @@ Kirigami.ScrollablePage {
|
||||||
visible: episodeProxyModel.filterType == EpisodeProxyModel.NoFilter
|
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 {
|
Kirigami.Dialog {
|
||||||
id: filterTypeOverlay
|
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,6 @@ Kirigami.ScrollablePage {
|
||||||
|
|
||||||
GenericEntryListView {
|
GenericEntryListView {
|
||||||
id: entryList
|
id: entryList
|
||||||
visible: true
|
|
||||||
reuseItems: true
|
reuseItems: true
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.kde.kasts 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: listView
|
id: listView
|
||||||
visible: count !== 0
|
|
||||||
clip: true
|
clip: true
|
||||||
property bool isQueue: false
|
property bool isQueue: false
|
||||||
property bool isDownloads: false
|
property bool isDownloads: false
|
||||||
|
|
|
@ -40,29 +40,20 @@ Kirigami.ScrollablePage {
|
||||||
|
|
||||||
contextualActions: queueList.defaultActionList
|
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 {
|
GenericEntryListView {
|
||||||
id: queueList
|
id: queueList
|
||||||
isQueue: true
|
isQueue: true
|
||||||
visible: count !== 0
|
|
||||||
anchors.fill: parent
|
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 {
|
header: ColumnLayout {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
@ -80,6 +71,14 @@ Kirigami.ScrollablePage {
|
||||||
id: queueModel
|
id: queueModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: delegateComponent
|
||||||
|
GenericEntryDelegate {
|
||||||
|
isQueue: true
|
||||||
|
listView: queueList
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delegate: Kirigami.DelegateRecycler {
|
delegate: Kirigami.DelegateRecycler {
|
||||||
width: queueList.width
|
width: queueList.width
|
||||||
sourceComponent: delegateComponent
|
sourceComponent: delegateComponent
|
||||||
|
|
Loading…
Reference in New Issue