From 13ca30ed98c9ab2c2155d2d60465a58dbda92137 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 13 Jul 2021 14:40:04 +0200 Subject: [PATCH] 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. --- .../resources/qml/SelectProjectPage.qml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml index ecec9556c9..08bf8aec7c 100644 --- a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml @@ -43,13 +43,20 @@ Item } height: childrenRect.height - TextField + Cura.TextField { id: searchBar Layout.fillWidth: true 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 "   Search"; + } } Cura.SecondaryButton