Fix the last material qml warnings

This commit is contained in:
Jaime van Kessel 2019-05-16 14:29:05 +02:00
parent bfe1275d46
commit 99e6ec9509
2 changed files with 15 additions and 3 deletions

View file

@ -271,7 +271,9 @@ Item
id: confirmRemoveMaterialDialog
icon: StandardIcon.Question;
title: catalog.i18nc("@title:window", "Confirm Remove")
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItem.name)
property string materialName: base.currentItem !== null ? base.currentItem.name : ""
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(materialName)
standardButtons: StandardButton.Yes | StandardButton.No
modality: Qt.ApplicationModal
onYes:

View file

@ -19,8 +19,18 @@ Rectangle
height: UM.Theme.getSize("favorites_row").height
width: parent.width
color: material != null ? (base.currentItem.root_material_id == material.root_material_id ? UM.Theme.getColor("favorites_row_selected") : "transparent") : "transparent"
//color: material != null ? (base.currentItem.root_material_id == material.root_material_id ? UM.Theme.getColor("favorites_row_selected") : "transparent") : "transparent"
color:
{
if(material !== null && base.currentItem !== null)
{
if(base.currentItem.root_material_id === material.root_material_id)
{
return UM.Theme.getColor("favorites_row_selected")
}
}
return "transparent"
}
Rectangle
{
id: swatch