mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-24 06:39:38 +08:00
Fix a number of QML warnings
This commit is contained in:
parent
843bb6f5a3
commit
bfe1275d46
@ -14,8 +14,11 @@ Item
|
||||
{
|
||||
id: material_type_section
|
||||
property var materialType
|
||||
property var expanded: materialList.expandedTypes.indexOf(materialType.brand + "_" + materialType.name) > -1
|
||||
property var colorsModel: materialType.colors
|
||||
|
||||
property string materialBrand: materialType != null ? materialType.brand : ""
|
||||
property string materialName: materialType != null ? materialType.name : ""
|
||||
property var expanded: materialList.expandedTypes.indexOf(materialBrand + "_" + materialName) > -1
|
||||
property var colorsModel: materialType != null ? materialType.colors: null
|
||||
height: childrenRect.height
|
||||
width: parent.width
|
||||
Rectangle
|
||||
@ -23,7 +26,7 @@ Item
|
||||
id: material_type_header_background
|
||||
color:
|
||||
{
|
||||
if(!expanded && materialType.brand + "_" + materialType.name == materialList.currentType)
|
||||
if(!expanded && materialBrand + "_" + materialName == materialList.currentType)
|
||||
{
|
||||
return UM.Theme.getColor("favorites_row_selected")
|
||||
}
|
||||
@ -55,7 +58,7 @@ Item
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: materialType.name
|
||||
text: materialName
|
||||
height: UM.Theme.getSize("favorites_row").height
|
||||
width: parent.width - parent.leftPadding - UM.Theme.getSize("favorites_button").width
|
||||
id: material_type_name
|
||||
@ -92,7 +95,7 @@ Item
|
||||
anchors.fill: material_type_header
|
||||
onPressed:
|
||||
{
|
||||
const identifier = materialType.brand + "_" + materialType.name;
|
||||
const identifier = materialBrand + "_" + materialName;
|
||||
const i = materialList.expandedTypes.indexOf(identifier)
|
||||
if (i > -1)
|
||||
{
|
||||
@ -135,7 +138,7 @@ Item
|
||||
return;
|
||||
}
|
||||
|
||||
expanded = materialList.expandedTypes.indexOf(materialType.brand + "_" + materialType.name) > -1
|
||||
expanded = materialList.expandedTypes.indexOf(materialBrand + "_" + materialName) > -1
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user