mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
property name hasSearchFilter changed
CURA-11003
This commit is contained in:
parent
2ed0377a05
commit
f35865e3c4
1 changed files with 4 additions and 4 deletions
|
@ -15,7 +15,7 @@ import Cura 1.1 as Cura
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: base
|
id: base
|
||||||
property bool searchFilterApplied: false
|
property bool hasSearchFilter: false
|
||||||
// The currently selected machine item in the local machine list.
|
// The currently selected machine item in the local machine list.
|
||||||
property var currentItem: machineList.currentIndex >= 0 ? machineList.model.getItem(machineList.currentIndex) : null
|
property var currentItem: machineList.currentIndex >= 0 ? machineList.model.getItem(machineList.currentIndex) : null
|
||||||
// The currently active (expanded) section/category, where section/category is the grouping of local machine items.
|
// The currently active (expanded) section/category, where section/category is the grouping of local machine items.
|
||||||
|
@ -121,14 +121,14 @@ Item
|
||||||
onEditingFinished:
|
onEditingFinished:
|
||||||
{
|
{
|
||||||
machineDefinitionsModel.filter = {"id" : "*" + text.toLowerCase() + "*", "visible": true}
|
machineDefinitionsModel.filter = {"id" : "*" + text.toLowerCase() + "*", "visible": true}
|
||||||
base.searchFilterApplied = (text.length > 0)
|
base.hasSearchFilter = (text.length > 0)
|
||||||
updateDefinitionModel()
|
updateDefinitionModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onEscapePressed: filter.text = ""
|
Keys.onEscapePressed: filter.text = ""
|
||||||
function updateDefinitionModel()
|
function updateDefinitionModel()
|
||||||
{
|
{
|
||||||
if (base.searchFilterApplied)
|
if (base.hasSearchFilter)
|
||||||
{
|
{
|
||||||
base.currentSections.clear()
|
base.currentSections.clear()
|
||||||
for (var i = 0; i < machineDefinitionsModel.count; i++)
|
for (var i = 0; i < machineDefinitionsModel.count; i++)
|
||||||
|
@ -162,7 +162,7 @@ Item
|
||||||
{
|
{
|
||||||
id: clearFilterButton
|
id: clearFilterButton
|
||||||
iconSource: UM.Theme.getIcon("Cancel")
|
iconSource: UM.Theme.getIcon("Cancel")
|
||||||
visible: base.searchFilterApplied
|
visible: base.hasSearchFilter
|
||||||
|
|
||||||
height: Math.round(filter.height * 0.4)
|
height: Math.round(filter.height * 0.4)
|
||||||
width: visible ? height : 0
|
width: visible ? height : 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue