mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Keep showing search icon while typing search query
This adds an option to the TextField element to show an icon on the left side in the text field. The icon remains visible when the user types in something (it's not part of the placeholder string). Then we use that optional icon for the search bar in the Digital Library. Contributes to issue CURA-8009.
This commit is contained in:
parent
1566a282dc
commit
bec83920e4
2 changed files with 24 additions and 6 deletions
|
@ -51,12 +51,8 @@ Item
|
|||
|
||||
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 + "> Search";
|
||||
}
|
||||
leftIcon: UM.Theme.getIcon("Magnifier")
|
||||
placeholderText: "Search"
|
||||
}
|
||||
|
||||
Cura.SecondaryButton
|
||||
|
@ -106,6 +102,7 @@ Item
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: searchBar.text === "" ? "It appears that you don't have any projects in the Library yet." : "No projects found that match the search query."
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
|
||||
Cura.TertiaryButton
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue