Show active material in italics

behaviour is not perfect; only one (of the possible multiple if you have
multiple materials) active material is shown in italics. However, this
behavior is similar as the behavior in cura v4.13

see
https://github.com/Ultimaker/Cura/pull/11668/files#diff-ba2e4797d4d21e847be25e2c272d6a7a45e3bab97def420bed7643d762be8cfaL54

CURA-9044
This commit is contained in:
casper 2022-03-22 12:00:56 +01:00
parent d7cf7ee97d
commit 1e15197d44

View file

@ -16,6 +16,7 @@ Rectangle
property var material: null
property bool hovered: false
property bool isActive: material !== null && Cura.MachineManager.currentRootMaterialId[Cura.ExtruderManager.activeExtruderIndex] == material.root_material_id
height: UM.Theme.getSize("preferences_page_list_item").height
width: parent.width
@ -52,6 +53,7 @@ Rectangle
{
id: materialLabel
text: material != null ? `${material.brand} ${material.name}` : ""
font: isActive ? UM.Theme.getFont("default_italic") : UM.Theme.getFont("default")
elide: Text.ElideRight
wrapMode: Text.NoWrap
verticalAlignment: Text.AlignVCenter