kdeconnect-app: Add filtering of plugins

Similar to the KCM
This commit is contained in:
Carl Schwan 2024-10-05 21:16:14 +02:00
parent 9832f380dc
commit 8d14fb17a3

View file

@ -8,18 +8,53 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
import org.kde.kitemmodels as KItemModels
import org.kde.kdeconnect import org.kde.kdeconnect
Kirigami.ScrollablePage { Kirigami.ScrollablePage {
id: root id: root
title: i18n("Plugin Settings")
property string device property string device
property string filterString
title: i18n("Plugin Settings")
header: Control {
topPadding: Kirigami.Units.smallSpacing
bottomPadding: Kirigami.Units.smallSpacing
leftPadding: Kirigami.Units.smallSpacing
rightPadding: Kirigami.Units.smallSpacing
background: Rectangle {
Kirigami.Theme.colorSet: Kirigami.Theme.Window
Kirigami.Theme.inherit: false
color: Kirigami.Theme.backgroundColor
Kirigami.Separator {
anchors {
left: parent.left
bottom: parent.bottom
right: parent.right
}
}
}
contentItem: Kirigami.SearchField {
id: searchField
onTextChanged: root.filterString = text;
autoAccept: false
}
}
ListView { ListView {
anchors.fill: parent model: KItemModels.KSortFilterProxyModel {
filterString: root.filterString
filterRoleName: "name"
filterCaseSensitivity: Qt.CaseInsensitive
model: PluginModel { sourceModel: PluginModel {
deviceId: device deviceId: device
}
} }
delegate: Kirigami.SwipeListItem { delegate: Kirigami.SwipeListItem {