add grouping and filtering to device lists

This commit is contained in:
Michael Zanetti 2018-10-09 00:58:48 +02:00
parent 10e8453094
commit 472a96766f
10 changed files with 490 additions and 28 deletions

View File

@ -131,6 +131,21 @@ void DevicesProxy::setHiddenInterfaces(const QStringList &hiddenInterfaces)
}
}
QString DevicesProxy::nameFilter() const
{
return m_nameFilter;
}
void DevicesProxy::setNameFilter(const QString &nameFilter)
{
if (m_nameFilter != nameFilter) {
m_nameFilter = nameFilter;
emit nameFilterChanged();
invalidateFilter();
countChanged();
}
}
bool DevicesProxy::filterBatteryCritical() const
{
return m_filterBatteryCritical;
@ -249,5 +264,11 @@ bool DevicesProxy::filterAcceptsRow(int source_row, const QModelIndex &source_pa
return false;
}
}
if (!m_nameFilter.isEmpty()) {
if (!device->name().toLower().contains(m_nameFilter.toLower().trimmed())) {
return false;
}
}
return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
}

View File

@ -40,6 +40,7 @@ class DevicesProxy : public QSortFilterProxyModel
Q_PROPERTY(QString filterTagId READ filterTagId WRITE setFilterTagId NOTIFY filterTagIdChanged)
Q_PROPERTY(QStringList shownInterfaces READ shownInterfaces WRITE setShownInterfaces NOTIFY shownInterfacesChanged)
Q_PROPERTY(QStringList hiddenInterfaces READ hiddenInterfaces WRITE setHiddenInterfaces NOTIFY hiddenInterfacesChanged)
Q_PROPERTY(QString nameFilter READ nameFilter WRITE setNameFilter NOTIFY nameFilterChanged)
// Setting this to true will imply filtering for "battery" interface
Q_PROPERTY(bool filterBatteryCritical READ filterBatteryCritical WRITE setFilterBatteryCritical NOTIFY filterBatteryCriticalChanged)
@ -67,6 +68,9 @@ public:
QStringList hiddenInterfaces() const;
void setHiddenInterfaces(const QStringList &hiddenInterfaces);
QString nameFilter() const;
void setNameFilter(const QString &nameFilter);
bool filterBatteryCritical() const;
void setFilterBatteryCritical(bool filterBatteryCritical);
@ -84,6 +88,7 @@ signals:
void filterTagIdChanged();
void shownInterfacesChanged();
void hiddenInterfacesChanged();
void nameFilterChanged();
void filterBatteryCriticalChanged();
void filterDisconnectedChanged();
void groupByInterfaceChanged();
@ -97,6 +102,7 @@ private:
QString m_filterTagId;
QStringList m_shownInterfaces;
QStringList m_hiddenInterfaces;
QString m_nameFilter;
bool m_filterBatteryCritical = false;
bool m_filterDisconnected = false;

View File

@ -264,5 +264,9 @@
<file>ui/images/fingerprint/fingerprint_boxes.json</file>
<file>ui/images/fingerprint/fingerprint_segmented.png</file>
<file>ui/images/fingerprint.svg</file>
<file>ui/components/ListSectionHeader.qml</file>
<file>ui/images/find.svg</file>
<file>ui/images/erase.svg</file>
<file>ui/components/ListFilterInput.qml</file>
</qresource>
</RCC>

View File

@ -11,6 +11,13 @@ Page {
text: qsTr("Configure Things")
onBackPressed: pageStack.pop()
HeaderButton {
imageSource: "../images/find.svg"
color: filterInput.shown ? app.accentColor : keyColor
onClicked: filterInput.shown = !filterInput.shown
}
HeaderButton {
imageSource: "../images/add.svg"
onClicked: pageStack.push(Qt.resolvedUrl("NewDeviceWizard.qml"))
@ -45,41 +52,46 @@ Page {
}
}
ListView {
ColumnLayout {
anchors.fill: parent
model: DevicesProxy {
id: deviceProxy
engine: _engine
groupByInterface: true
}
section.property: "baseInterface"
section.criteria: ViewSection.FullString
section.delegate: ColumnLayout {
width: parent.width
Label {
Layout.fillWidth: true
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
Layout.topMargin: app.margins
text: app.interfaceToString(section)
horizontalAlignment: Text.AlignRight
}
ThinDivider {}
ListFilterInput {
id: filterInput
Layout.fillWidth: true
}
delegate: ThingDelegate {
device: deviceProxy.get(index)
canDelete: true
onClicked: {
pageStack.push(Qt.resolvedUrl("devicepages/ConfigureThingPage.qml"), {device: deviceProxy.get(index)})
ListView {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: DevicesProxy {
id: deviceProxy
engine: _engine
groupByInterface: true
nameFilter: filterInput.shown ? filterInput.text : ""
}
onDeleteClicked: {
d.deviceToRemove = deviceProxy.get(index);
engine.deviceManager.removeDevice(d.deviceToRemove.id)
section.property: "baseInterface"
section.criteria: ViewSection.FullString
section.delegate: ListSectionHeader {
text: app.interfaceToString(section)
}
delegate: ThingDelegate {
device: deviceProxy.get(index)
canDelete: true
onClicked: {
pageStack.push(Qt.resolvedUrl("devicepages/ConfigureThingPage.qml"), {device: deviceProxy.get(index)})
}
onDeleteClicked: {
d.deviceToRemove = deviceProxy.get(index);
engine.deviceManager.removeDevice(d.deviceToRemove.id)
}
}
}
}
EmptyViewPlaceholder {
anchors { left: parent.left; right: parent.right; margins: app.margins }
anchors.verticalCenter: parent.verticalCenter

View File

@ -0,0 +1,38 @@
import QtQuick 2.6
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.1
import "../components"
import "../delegates"
import Nymea 1.0
Item {
id: root
opacity: shown ? 1 : 0
implicitWidth: searchColumn.implicitWidth
implicitHeight: shown ? searchColumn.implicitHeight : 0
Behavior on implicitHeight {NumberAnimation { duration: 130; easing.type: Easing.InOutQuad }}
property bool shown: false
property alias text: searchTextField.displayText
ColumnLayout {
id: searchColumn
anchors { left: parent.left; bottom: parent.bottom; right: parent.right }
RowLayout {
Layout.margins: app.margins
spacing: app.margins
TextField {
id: searchTextField
Layout.fillWidth: true
}
HeaderButton {
imageSource: "../images/erase.svg"
onClicked: searchTextField.text = ""
enabled: searchTextField.displayText.length > 0
color: enabled ? app.accentColor : keyColor
}
}
ThinDivider {}
}
}

View File

@ -0,0 +1,17 @@
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
ColumnLayout {
width: parent.width
property alias text: label.text
Label {
id: label
Layout.fillWidth: true
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
Layout.topMargin: app.margins
horizontalAlignment: Text.AlignRight
}
ThinDivider {}
}

View File

@ -8,7 +8,7 @@ MeaListItemDelegate {
id: root
width: parent.width
iconName: deviceClass ? app.interfacesToIcon(deviceClass.interfaces) : ""
text: device.name
text: device ? device.name : ""
progressive: true
secondaryIconName: batteryCritical ? "../images/battery/battery-010.svg" : ""
tertiaryIconName: disconnected ? "../images/dialog-warning-symbolic.svg" : ""

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96"
height="96"
id="svg4874"
version="1.1"
inkscape:version="0.91+devel r"
viewBox="0 0 96 96.000001"
sodipodi:docname="erase.svg">
<defs
id="defs4876" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="13.720701"
inkscape:cx="49.629384"
inkscape:cy="43.339612"
inkscape:document-units="px"
inkscape:current-layer="g4780"
showgrid="true"
showborder="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-global="true">
<inkscape:grid
type="xygrid"
id="grid5451"
empspacing="8" />
<sodipodi:guide
orientation="1,0"
position="8,-8.0000001"
id="guide4063" />
<sodipodi:guide
orientation="1,0"
position="4,-8.0000001"
id="guide4065" />
<sodipodi:guide
orientation="0,1"
position="-8,88.000001"
id="guide4067" />
<sodipodi:guide
orientation="0,1"
position="-8,92.000001"
id="guide4069" />
<sodipodi:guide
orientation="0,1"
position="104,4"
id="guide4071" />
<sodipodi:guide
orientation="0,1"
position="-5,8.0000001"
id="guide4073" />
<sodipodi:guide
orientation="1,0"
position="88,-8.0000001"
id="guide4077" />
<sodipodi:guide
orientation="0,1"
position="-8,84.000001"
id="guide4074" />
<sodipodi:guide
orientation="1,0"
position="12,-8.0000001"
id="guide4076" />
<sodipodi:guide
orientation="1,0"
position="84,-8.0000001"
id="guide4080" />
<sodipodi:guide
position="48,-8.0000001"
orientation="1,0"
id="guide4170" />
<sodipodi:guide
position="-8,48"
orientation="0,1"
id="guide4172" />
<sodipodi:guide
position="92,-8.0000001"
orientation="1,0"
id="guide4760" />
</sodipodi:namedview>
<metadata
id="metadata4879">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(67.857146,-78.50504)">
<g
transform="matrix(0,-1,-1,0,373.50506,516.50504)"
id="g4845"
style="display:inline">
<g
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="next01.png"
transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
id="g4778"
inkscape:label="Layer 1">
<g
transform="matrix(-1,0,0,1,575.99999,611)"
id="g4780"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
id="rect4782"
width="96.037987"
height="96"
x="-438.00244"
y="345.36221"
transform="scale(-1,1)" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;enable-background:accumulate"
d="M 44.933594 23.953125 C 44.933604 23.953125 22.056529 34.707236 2.0371094 51 L 2.0292969 51 C 2.0202969 51.006997 2.0093 51.013787 2 51.021484 L 2.0058594 51.021484 L 2.0058594 51.023438 L 2 51.023438 C 2.009 51.030435 2.0200969 51.037725 2.0292969 51.044922 L 2.0371094 51.044922 C 22.056659 67.337696 44.933604 78.044922 44.933594 78.044922 L 44.933594 78 L 94 78 L 94 51.044922 L 94 51 L 94 24 L 44.933594 24 L 44.933594 23.955078 L 44.933594 23.953125 z M 45.837891 28.023438 L 89.976562 28.023438 L 89.976562 51 L 89.976562 51.044922 L 89.976562 73.978516 L 45.837891 73.978516 C 44.673341 73.426294 26.633924 64.608888 8.8027344 51.021484 C 26.632604 37.429642 44.665521 28.581657 45.837891 28.023438 z "
transform="matrix(0,-1,-1.0003957,0,438.00245,441.36222)"
id="path4209" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 373.80469,359.36133 -2.82813,2.83008 28.1836,28.17187 2.82812,-2.83008 -28.18359,-28.17187 z"
id="path4216"
inkscape:connector-curvature="0" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 399.16016,359.36133 -28.1836,28.17187 2.82813,2.83008 28.18359,-28.17187 -2.82812,-2.83008 z"
id="path4218"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96"
height="96"
id="svg4874"
version="1.1"
inkscape:version="0.91+devel r"
viewBox="0 0 96 96.000001"
sodipodi:docname="find.svg">
<defs
id="defs4876" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.5967996"
inkscape:cx="-36.35177"
inkscape:cy="61.234959"
inkscape:document-units="px"
inkscape:current-layer="g4780"
showgrid="true"
showborder="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
showguides="true"
inkscape:guide-bbox="true">
<inkscape:grid
type="xygrid"
id="grid5451"
empspacing="8" />
<sodipodi:guide
orientation="1,0"
position="8,-8.0000001"
id="guide4063" />
<sodipodi:guide
orientation="1,0"
position="4,-8.0000001"
id="guide4065" />
<sodipodi:guide
orientation="0,1"
position="-8,88.000001"
id="guide4067" />
<sodipodi:guide
orientation="0,1"
position="-8,92.000001"
id="guide4069" />
<sodipodi:guide
orientation="0,1"
position="104,4"
id="guide4071" />
<sodipodi:guide
orientation="0,1"
position="-5,8.0000001"
id="guide4073" />
<sodipodi:guide
orientation="1,0"
position="92,-8.0000001"
id="guide4075" />
<sodipodi:guide
orientation="1,0"
position="88,-8.0000001"
id="guide4077" />
<sodipodi:guide
orientation="0,1"
position="-8,84.000001"
id="guide4074" />
<sodipodi:guide
orientation="1,0"
position="12,-8.0000001"
id="guide4076" />
<sodipodi:guide
orientation="0,1"
position="-5,12"
id="guide4078" />
<sodipodi:guide
orientation="1,0"
position="84,-9.0000001"
id="guide4080" />
<sodipodi:guide
position="48,-8.0000001"
orientation="1,0"
id="guide4170" />
<sodipodi:guide
position="-8,48"
orientation="0,1"
id="guide4172" />
</sodipodi:namedview>
<metadata
id="metadata4879">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(67.857146,-78.50504)">
<g
transform="matrix(0,-1,-1,0,373.50506,516.50504)"
id="g4845"
style="display:inline">
<g
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="next01.png"
transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
id="g4778"
inkscape:label="Layer 1">
<g
transform="matrix(-1,0,0,1,575.99999,611)"
id="g4780"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
id="rect4782"
width="96.037987"
height="96"
x="-438.00244"
y="345.36221"
transform="scale(-1,1)" />
<path
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#808080;fill-opacity:1;stroke:none"
d="m 364.0904,368.96573 c -0.0215,-0.0161 -0.0354,-0.0404 -0.0567,-0.0566 -0.0253,-0.0201 -0.057,-0.0305 -0.0821,-0.0508 z"
id="path4157" />
<path
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#808080;fill-opacity:1;stroke:none"
d="m 364.07673,417.80167 -0.13873,0.10742 c 0.0251,-0.0203 0.0569,-0.0307 0.0821,-0.0508 0.0214,-0.0162 0.0353,-0.0405 0.0567,-0.0566 z"
id="path4344" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 432,400.36133 c 0,19.30739 -15.69992,35 -35.01367,35 -19.31376,0 -35.01367,-15.69261 -35.01367,-35 0,-19.30739 15.69991,-35.00195 35.01367,-35.00195 19.31375,0 35.01367,15.69456 35.01367,35.00195 z m -4,0 c 0,-17.14435 -13.86125,-31.00196 -31.01367,-31.00195 -17.15243,0 -31.01367,13.8576 -31.01367,31.00195 0,17.14434 13.86124,31 31.01367,31 17.15242,0 31.01367,-13.85566 31.01367,-31 z"
id="path4116"
inkscape:connector-curvature="0" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:none;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:6.00118685;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 353.08984,352.24023 -4.24218,4.24415 22.67187,22.66406 4.24219,-4.24414 -22.67188,-22.66407 z"
id="path4229"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -25,6 +25,12 @@ Page {
qsTr("Select a kind of things") :
root.shownInterfaces.length > 0 ? qsTr("Select a %1").arg(app.interfaceToDisplayName(root.shownInterfaces[0])) : qsTr("Select a thing")
onBackPressed: root.backPressed()
HeaderButton {
imageSource: "../images/find.svg"
color: filterInput.shown ? app.accentColor : keyColor
onClicked: filterInput.shown = !filterInput.shown
}
}
InterfacesProxy {
@ -35,6 +41,8 @@ Page {
DevicesProxy {
id: devicesProxy
engine: _engine
groupByInterface: true
nameFilter: filterInput.shown ? filterInput.text : ""
}
ColumnLayout {
@ -50,11 +58,21 @@ Page {
}
ThinDivider { visible: root.allowSelectAny }
ListFilterInput {
id: filterInput
Layout.fillWidth: true
}
ListView {
Layout.fillWidth: true
Layout.fillHeight: true
model: root.selectInterface ? interfacesProxy : devicesProxy
clip: true
section.property: "baseInterface"
section.criteria: ViewSection.FullString
section.delegate: ListSectionHeader {
text: app.interfaceToString(section)
}
delegate: MeaListItemDelegate {
width: parent.width
text: root.selectInterface ? model.displayName : model.name