Steal search-bar from DigitalFactory.

Make 'SearchBar' into a reusable component, so it can be used in the (new) Marketplace search. Also now at least the word 'Search' can be translated ;-)

part of CURA-8559
This commit is contained in:
Remco Burema 2021-11-12 09:52:24 +01:00
parent 2cdda695e9
commit 977a12c989
No known key found for this signature in database
GPG key ID: 215C49431D43F98C
2 changed files with 38 additions and 24 deletions

View file

@ -0,0 +1,36 @@
// Copyright (C) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1
import UM 1.6 as UM
import Cura 1.7 as Cura
Cura.TextField
{
UM.I18nCatalog { id: catalog; name: "cura" }
Layout.fillWidth: true
implicitHeight: createNewProjectButton.height
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
placeholderText: catalog.i18nc("@placeholder", "Search")
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")
}
}