mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 08:09:00 +08:00
Merge branch '3.0' of github.com:Ultimaker/Cura into 3.0
This commit is contained in:
commit
2884e1e5b5
@ -112,7 +112,13 @@ class MachineSettingsAction(MachineAction):
|
|||||||
if not self._global_container_stack:
|
if not self._global_container_stack:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
return len(self._global_container_stack.getMetaDataEntry("machine_extruder_trains"))
|
# If there is a printer that originally is multi-extruder, it's not allowed to change the number of extruders
|
||||||
|
# It's just allowed in case of Custom FDM printers
|
||||||
|
definition_container = self._global_container_stack.getBottom()
|
||||||
|
if definition_container.getId() == "custom":
|
||||||
|
return len(self._global_container_stack.getMetaDataEntry("machine_extruder_trains"))
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def setMachineExtruderCount(self, extruder_count):
|
def setMachineExtruderCount(self, extruder_count):
|
||||||
|
@ -309,7 +309,7 @@ Item
|
|||||||
|
|
||||||
text: catalog.i18nc("@label", "Slower")
|
text: catalog.i18nc("@label", "Slower")
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
color: UM.Theme.getColor("text")
|
color: (qualityModel.availableTotalTicks > 0) ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ Item
|
|||||||
|
|
||||||
text: catalog.i18nc("@label", "Faster")
|
text: catalog.i18nc("@label", "Faster")
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
color: UM.Theme.getColor("text")
|
color: (qualityModel.availableTotalTicks > 0) ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||||
horizontalAlignment: Text.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -354,8 +354,6 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: infillCellRight
|
id: infillCellRight
|
||||||
@ -395,7 +393,7 @@ Item
|
|||||||
|
|
||||||
minimumValue: 0
|
minimumValue: 0
|
||||||
maximumValue: 100
|
maximumValue: 100
|
||||||
stepSize: 10
|
stepSize: (parseInt(infillDensity.properties.value) % 10 == 0) ? 10 : 1
|
||||||
tickmarksEnabled: true
|
tickmarksEnabled: true
|
||||||
|
|
||||||
// disable slider when gradual support is enabled
|
// disable slider when gradual support is enabled
|
||||||
@ -405,12 +403,12 @@ Item
|
|||||||
value: parseInt(infillDensity.properties.value)
|
value: parseInt(infillDensity.properties.value)
|
||||||
|
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
infillDensity.setPropertyValue("value", infillSlider.value)
|
// Explicitly cast to string to make sure the value passed to Python is an integer.
|
||||||
|
infillDensity.setPropertyValue("value", String(parseInt(infillSlider.value)))
|
||||||
}
|
}
|
||||||
|
|
||||||
style: SliderStyle
|
style: SliderStyle
|
||||||
{
|
{
|
||||||
|
|
||||||
groove: Rectangle {
|
groove: Rectangle {
|
||||||
id: groove
|
id: groove
|
||||||
implicitWidth: 200 * screenScaleFactor
|
implicitWidth: 200 * screenScaleFactor
|
||||||
@ -433,6 +431,15 @@ Item
|
|||||||
tickmarks: Repeater {
|
tickmarks: Repeater {
|
||||||
id: repeater
|
id: repeater
|
||||||
model: control.maximumValue / control.stepSize + 1
|
model: control.maximumValue / control.stepSize + 1
|
||||||
|
|
||||||
|
// check if a tick should be shown based on it's index and wether the infill density is a multiple of 10 (slider step size)
|
||||||
|
function shouldShowTick (index) {
|
||||||
|
if ((parseInt(infillDensity.properties.value) % 10 == 0) || (index % 10 == 0)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||||
@ -440,6 +447,7 @@ Item
|
|||||||
height: 6 * screenScaleFactor
|
height: 6 * screenScaleFactor
|
||||||
y: 0
|
y: 0
|
||||||
x: styleData.handleWidth / 2 + index * ((repeater.width - styleData.handleWidth) / (repeater.count-1))
|
x: styleData.handleWidth / 2 + index * ((repeater.width - styleData.handleWidth) / (repeater.count-1))
|
||||||
|
visible: shouldShowTick(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -485,7 +493,7 @@ Item
|
|||||||
visible: infillIconList.activeIndex == index
|
visible: infillIconList.activeIndex == index
|
||||||
|
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: UM.Theme.getColor("quality_slider_available")
|
border.color: UM.Theme.getColor("quality_slider_unavailable")
|
||||||
|
|
||||||
UM.RecolorImage {
|
UM.RecolorImage {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -505,7 +513,7 @@ Item
|
|||||||
property alias _hovered: enableGradualInfillMouseArea.containsMouse
|
property alias _hovered: enableGradualInfillMouseArea.containsMouse
|
||||||
|
|
||||||
anchors.top: infillSlider.bottom
|
anchors.top: infillSlider.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
|
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height / 2 // closer to slider since it belongs to the same category
|
||||||
anchors.left: infillCellRight.left
|
anchors.left: infillCellRight.left
|
||||||
|
|
||||||
style: UM.Theme.styles.checkbox
|
style: UM.Theme.styles.checkbox
|
||||||
@ -725,15 +733,19 @@ Item
|
|||||||
{
|
{
|
||||||
id: adhesionHelperLabel
|
id: adhesionHelperLabel
|
||||||
visible: adhesionCheckBox.visible
|
visible: adhesionCheckBox.visible
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
|
text: catalog.i18nc("@label", "Build Plate Adhesion")
|
||||||
anchors.right: infillCellLeft.right
|
font: UM.Theme.getFont("default")
|
||||||
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
|
color: UM.Theme.getColor("text")
|
||||||
anchors.verticalCenter: adhesionCheckBox.verticalCenter
|
|
||||||
text: catalog.i18nc("@label", "Build Plate Adhesion");
|
|
||||||
font: UM.Theme.getFont("default");
|
|
||||||
color: UM.Theme.getColor("text");
|
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
leftMargin: UM.Theme.getSize("sidebar_margin").width
|
||||||
|
right: infillCellLeft.right
|
||||||
|
rightMargin: UM.Theme.getSize("sidebar_margin").width
|
||||||
|
verticalCenter: adhesionCheckBox.verticalCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBox
|
CheckBox
|
||||||
@ -828,7 +840,6 @@ Item
|
|||||||
UM.SettingPropertyProvider
|
UM.SettingPropertyProvider
|
||||||
{
|
{
|
||||||
id: infillExtruderNumber
|
id: infillExtruderNumber
|
||||||
|
|
||||||
containerStackId: Cura.MachineManager.activeStackId
|
containerStackId: Cura.MachineManager.activeStackId
|
||||||
key: "infill_extruder_nr"
|
key: "infill_extruder_nr"
|
||||||
watchedProperties: [ "value" ]
|
watchedProperties: [ "value" ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user