Make switching Marketplace-tabs work with search-bar.

Reset search-bar (text) when switching tabs. Also hide search-bar (at least for now) when dealing with the managed packages tab.

part of CURA-8559
This commit is contained in:
Remco Burema 2021-11-12 15:37:59 +01:00
parent 44242dcd02
commit 24eaad4c6d
No known key found for this signature in database
GPG key ID: 215C49431D43F98C

View file

@ -86,7 +86,8 @@ Window
Rectangle
{
Layout.preferredHeight: parent.height
Layout.preferredWidth: UM.Theme.getSize("thin_margin").width
Layout.preferredWidth: searchBar.visible ? UM.Theme.getSize("thin_margin").width : 0
Layout.fillWidth: ! searchBar.visible
}
Cura.SearchBar
@ -94,7 +95,7 @@ Window
id: searchBar
Layout.preferredHeight: parent.height
Layout.fillWidth: true
onTextEdited: marketplaceDialog.searchStringChanged(text)
onTextEdited: searchStringChanged(text)
}
// Page selection.
@ -111,7 +112,12 @@ Window
width: implicitWidth
padding: UM.Theme.getSize("thin_margin").width
text: catalog.i18nc("@button", "Plugins")
onClicked: content.source = "Plugins.qml"
onClicked:
{
searchBar.text = ""
searchBar.visible = true
content.source = "Plugins.qml"
}
}
PackageTypeTab
{
@ -119,7 +125,12 @@ Window
width: implicitWidth
padding: UM.Theme.getSize("thin_margin").width
text: catalog.i18nc("@button", "Materials")
onClicked: content.source = "Materials.qml"
onClicked:
{
searchBar.text = ""
searchBar.visible = true
content.source = "Materials.qml"
}
}
}
TextMetrics
@ -143,6 +154,8 @@ Window
onClicked:
{
searchBar.text = ""
searchBar.visible = false
content.source = "ManagedPackages.qml"
}
}