Stylise search bar

This is the standard style for text fields in Cura. The spacing around the search icon is customised with the best approximation I could get using a simple string of placeholderText.

Contributes to issue CURA-8009.
This commit is contained in:
Ghostkeeper 2021-07-13 14:40:04 +02:00
parent 1269c28d0a
commit 13ca30ed98
No known key found for this signature in database
GPG key ID: 68F39EA88EEED5FF

View file

@ -43,13 +43,20 @@ Item
} }
height: childrenRect.height height: childrenRect.height
TextField Cura.TextField
{ {
id: searchBar id: searchBar
Layout.fillWidth: true Layout.fillWidth: true
height: createNewProjectButton.height height: createNewProjectButton.height
onTextEdited: manager.projectFilter = text onTextEdited: manager.projectFilter = text //Update the search filter when editing this text field.
placeholderText:
{
var image_size = "width=\"" + UM.Theme.getSize("small_button_icon").width + "\" height=\"" + UM.Theme.getSize("small_button_icon").height + "\" ";
var image_source = "src=\"" + UM.Theme.getIcon("Magnifier") + "\"";
return "<img align=\"middle\" " + image_size + image_source + "> &nbsp; Search";
}
} }
Cura.SecondaryButton Cura.SecondaryButton