diff --git a/src/settings.qml b/src/settings.qml index b442bfbab..2df726330 100644 --- a/src/settings.qml +++ b/src/settings.qml @@ -1066,6 +1066,73 @@ import QtQuick.Dialogs 1.0 spacing: 0 anchors.fill: parent + Row + { + spacing: 5 + Text + { + text:"Filter" + color: "white" + verticalAlignment: Text.AlignVCenter + } + TextField + { + function checkChildren(test) { + var text = filterField.text.toUpperCase() + for (var i = 0; i < test.children.length; i++) + { + if(test.children[i] instanceof Label || test.children[i] instanceof SwitchDelegate) { + //console.log(test.children[i].objectName); + if(test.children[i].objectName !== undefined) { + if(test.children[i].objectName.indexOf("rebootLabel") !== -1) { + continue; + } + } + + if(test.children[i].text !== undefined) { + //console.log(test.children[i].text); + if(test.children[i] instanceof Label) { + test.visible = (test.children[i].text.toUpperCase().indexOf(text) !== -1); + } else { + test.children[i].visible = (test.children[i].text.toUpperCase().indexOf(text) !== -1); + } + } + if(test.children[i].title !== undefined) { + //console.log(test.children[i].title); + if(test.children[i] instanceof Label) { + test.visible = (test.children[i].title.toUpperCase().indexOf(text) !== -1); + } else { + test.children[i].visible = (test.children[i].title.toUpperCase().indexOf(text) !== -1); + } + } + } + if(test.children[i] instanceof AccordionElement) { + test.children[i].isOpen = true; + } + checkChildren(test.children[i]); + } + } + + function updateFilter() + { + checkChildren(column1); + } + id: filterField + onTextChanged: updateFilter() + } + } + + Label { + Layout.preferredWidth: parent.width + id: rebootLabel + objectName: "rebootLabel" + text: qsTr("Reboot the app in order to apply the settings") + textFormat: Text.PlainText + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignVCenter + color: Material.color(Material.Red) + } + AccordionElement { id: generalOptionsAccordion title: qsTr("General Options")