Warning, /multimedia/kasts/src/qml/FilterInlineMessage.qml is written in an unsupported language. File is not indexed.

0001 /**
0002  * SPDX-FileCopyrightText: 2023 Bart De Vries <bart@mogwai.be>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 import QtQuick
0008 import QtQuick.Controls as Controls
0009 import org.kde.kirigami as Kirigami
0010 
0011 import org.kde.kasts
0012 
0013 
0014 Kirigami.InlineMessage {
0015     required property var proxyModel
0016 
0017     anchors {
0018         horizontalCenter: parent.horizontalCenter
0019         bottom: parent.bottom
0020         margins: Kirigami.Units.largeSpacing
0021         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 )
0022     }
0023     type: Kirigami.MessageType.Information
0024     visible: proxyModel.filterType != AbstractEpisodeProxyModel.NoFilter
0025     text: textMetrics.text
0026     width: Math.min(textMetrics.width + 2 * Kirigami.Units.largeSpacing + 10 * Kirigami.Units.gridUnit, parent.width - anchors.leftMargin - anchors.rightMargin)
0027 
0028     actions: [
0029         Kirigami.Action {
0030             id: resetButton
0031             icon.name: "edit-delete-remove"
0032             text: i18nc("@action:button Reset filters active on ListView", "Reset")
0033             onTriggered: {
0034                 proxyModel.filterType = AbstractEpisodeProxyModel.NoFilter;
0035             }
0036         }
0037     ]
0038 
0039     TextMetrics {
0040         id: textMetrics
0041         text: i18nc("@info:status Name of the filter which is active on the ListView", "Active filter: %1", proxyModel.filterName)
0042     }
0043 }