mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 04:05:25 +08:00
Merge branch 'CURA-6590_continue_fix_diameter_reset'
This commit is contained in:
commit
6941af0022
@ -1112,9 +1112,17 @@ class MachineManager(QObject):
|
||||
def _onRootMaterialChanged(self) -> None:
|
||||
self._current_root_material_id = {}
|
||||
|
||||
changed = False
|
||||
|
||||
if self._global_container_stack:
|
||||
for position in self._global_container_stack.extruders:
|
||||
self._current_root_material_id[position] = self._global_container_stack.extruders[position].material.getMetaDataEntry("base_file")
|
||||
material_id = self._global_container_stack.extruders[position].material.getMetaDataEntry("base_file")
|
||||
if position not in self._current_root_material_id or material_id != self._current_root_material_id[position]:
|
||||
changed = True
|
||||
self._current_root_material_id[position] = material_id
|
||||
|
||||
if changed:
|
||||
self.activeMaterialChanged.emit()
|
||||
|
||||
@pyqtProperty("QVariant", notify = rootMaterialChanged)
|
||||
def currentRootMaterialId(self) -> Dict[str, str]:
|
||||
|
@ -49,6 +49,15 @@ Item
|
||||
// When loaded, try to select the active material in the tree
|
||||
Component.onCompleted: resetExpandedActiveMaterial()
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onActiveMaterialChanged:
|
||||
{
|
||||
resetExpandedActiveMaterial()
|
||||
}
|
||||
}
|
||||
|
||||
// Every time the selected item has changed, notify to the details panel
|
||||
onCurrentItemChanged:
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ Rectangle
|
||||
anchors.left: swatch.right
|
||||
anchors.verticalCenter: materialSlot.verticalCenter
|
||||
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
|
||||
font.italic: Cura.MachineManager.currentRootMaterialId[Cura.ExtruderManager.activeExtruderIndex] == material.root_material_id
|
||||
font.italic: material != null && Cura.MachineManager.currentRootMaterialId[Cura.ExtruderManager.activeExtruderIndex] == material.root_material_id
|
||||
}
|
||||
MouseArea
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user