Merge branch '4.0'

This commit is contained in:
Diego Prado Gesto 2019-01-20 21:25:19 +01:00
commit 5e3dedf62b
6 changed files with 48 additions and 32 deletions

View file

@ -151,7 +151,7 @@ class CuraEngineBackend(QObject, Backend):
if self._multi_build_plate_model:
self._multi_build_plate_model.activeBuildPlateChanged.connect(self._onActiveViewChanged)
self._application.globalContainerStackChanged.connect(self._onGlobalStackChanged)
self._application.getMachineManager().globalContainerChanged.connect(self._onGlobalStackChanged)
self._onGlobalStackChanged()
# extruder enable / disable. Actually wanted to use machine manager here, but the initialization order causes it to crash
@ -821,7 +821,7 @@ class CuraEngineBackend(QObject, Backend):
extruder.propertyChanged.disconnect(self._onSettingChanged)
extruder.containersChanged.disconnect(self._onChanged)
self._global_container_stack = self._application.getGlobalContainerStack()
self._global_container_stack = self._application.getMachineManager().activeMachine
if self._global_container_stack:
self._global_container_stack.propertyChanged.connect(self._onSettingChanged) # Note: Only starts slicing when the value changed.

View file

@ -19,7 +19,7 @@ Item
property int position: 0
// The extruder icon size; NOTE: This shouldn't need to be changed
property int size: 32 // TODO: Theme!
property int size: 32 * screenScaleFactor // TODO: Theme!
// THe extruder icon source; NOTE: This shouldn't need to be changed
property string iconSource: "../svg/icons/extruder.svg"
@ -35,27 +35,17 @@ Item
width: size
}
/*
* The label uses some "fancy" math to ensure that if you change the overall
* icon size, the number scales with it. That is to say, the font properties
* are linked to the icon size, NOT the theme. And that's intentional.
*/
Label
{
id: positionLabel
font
{
pointSize: Math.round(size * 0.3125)
weight: Font.Bold
}
height: Math.round(size / 2) * screenScaleFactor
font: UM.Theme.getFont("small")
height: Math.round(size / 2)
horizontalAlignment: Text.AlignHCenter
text: position + 1
verticalAlignment: Text.AlignVCenter
width: Math.round(size / 2) * screenScaleFactor
x: Math.round(size * 0.25) * screenScaleFactor
y: Math.round(size * 0.15625) * screenScaleFactor
// TODO: Once 'size' is themed, screenScaleFactor won't be needed
width: Math.round(size / 2)
x: Math.round(size * 0.25)
y: Math.round(size * 0.15625)
visible: position >= 0
}
}