-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
SearchField.qml
37 lines (30 loc) · 1000 Bytes
/
SearchField.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-FileCopyrightText: 2021 Jonah Brüchert <[email protected]>
// SPDX-FileCopyrightText: 2023 Mathis Brüchert <[email protected]>
// SPDX-FileCopyrightText: 2023 Carl Schwan <[email protected]>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
import QtQuick
import QtQuick.Controls 2 as QQC2
import QtQuick.Layouts
import org.kde.kirigami 2 as Kirigami
import org.kde.kirigamiaddons.labs.components 1 as KirigamiComponents
import org.kde.tokodon
/**
* SearchField with a Popup to show autocompletion entries or search results
*/
KirigamiComponents.SearchPopupField {
id: root
property alias searchModel: searchView.model
leftPadding: 0
topPadding: 0
bottomPadding: 0
rightPadding: 0
spaceAvailableLeft: false
delaySearch: true
onAccepted: searchModel.search(text)
popupContentItem: SearchView {
id: searchView
text: root.text
onItemSelected: root.popup.close()
clip: true
}
}