mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 16:28:59 +08:00
Highlight the material that is currently selected.
Contributes to CURA-5682.
This commit is contained in:
parent
6d2492e5cb
commit
56dcc2dded
@ -19,19 +19,8 @@ Rectangle
|
|||||||
|
|
||||||
height: UM.Theme.getSize("favorites_row").height
|
height: UM.Theme.getSize("favorites_row").height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
color: base.currentItem == model ? UM.Theme.getColor("favorites_row_selected") : "transparent"
|
color: base.currentItem.root_material_id == material.root_material_id ? UM.Theme.getColor("favorites_row_selected") : "transparent"
|
||||||
|
|
||||||
Component.onCompleted:
|
|
||||||
{
|
|
||||||
if (material.root_material_id == base.active_root_material_id) {
|
|
||||||
base.currentItem = material
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item
|
|
||||||
{
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
id: swatch
|
id: swatch
|
||||||
@ -58,9 +47,9 @@ Rectangle
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
base.currentItem = material
|
|
||||||
materialList.currentBrand = material.brand
|
materialList.currentBrand = material.brand
|
||||||
materialList.currentType = material.brand + "_" + material.material
|
materialList.currentType = material.brand + "_" + material.material
|
||||||
|
base.currentItem = material
|
||||||
}
|
}
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: { material_slot.hovered = true }
|
onEntered: { material_slot.hovered = true }
|
||||||
@ -128,5 +117,4 @@ Rectangle
|
|||||||
source: material_slot.is_favorite ? UM.Theme.getIcon("favorites_star_full") : UM.Theme.getIcon("favorites_star_empty")
|
source: material_slot.is_favorite ? UM.Theme.getIcon("favorites_star_full") : UM.Theme.getIcon("favorites_star_empty")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user