Use re-usable search-bar for Settings search as well.

done as part of CURA-8559
This commit is contained in:
Remco Burema 2021-11-16 10:20:08 +01:00
parent 24eaad4c6d
commit 87f94e680b
No known key found for this signature in database
GPG Key ID: 215C49431D43F98C
2 changed files with 6 additions and 28 deletions

View File

@ -15,6 +15,7 @@ Cura.TextField
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
placeholderText: catalog.i18nc("@placeholder", "Search")
font.italic: true
UM.RecolorImage
{

View File

@ -41,39 +41,19 @@ Item
repeat: false
}
Cura.TextField
Cura.SearchBar
{
id: filter
height: parent.height
anchors.left: parent.left
anchors.right: parent.right
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
placeholderText: catalog.i18nc("@label:textbox", "Search settings")
font.italic: true
placeholderText: catalog.i18nc("@label:textbox", "Search settings") // Overwrite
property var expandedCategories
property bool lastFindingSettings: false
UM.RecolorImage
{
id: searchIcon
anchors
{
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
}
source: UM.Theme.getIcon("search")
height: UM.Theme.getSize("small_button_icon").height
width: height
color: UM.Theme.getColor("text")
}
onTextChanged:
{
settingsSearchTimer.restart()
}
onTextChanged: settingsSearchTimer.restart()
onEditingFinished:
{
@ -86,10 +66,7 @@ Item
}
}
Keys.onEscapePressed:
{
filter.text = ""
}
Keys.onEscapePressed: filter.text = ""
function updateDefinitionModel()
{