Merge branch 'master' of github.com:Ultimaker/Cura into replace_controls_1_for_controls_2

This commit is contained in:
Jaime van Kessel 2022-01-03 15:32:58 +01:00
commit f11d728c6b
838 changed files with 99530 additions and 92324 deletions

View file

@ -50,10 +50,16 @@ Cura.ExpandablePopup
model: extrudersModel
delegate: Item
{
id: extruderItem
Layout.preferredWidth: Math.round(parent.width / extrudersModel.count)
Layout.maximumWidth: Math.round(parent.width / extrudersModel.count)
Layout.fillHeight: true
property var extruderStack: Cura.MachineManager.activeMachine.extruders[model.index]
property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack)
property bool valueError: Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True"
// Extruder icon. Shows extruder index and has the same color as the active material.
Cura.ExtruderIcon
{
@ -63,6 +69,113 @@ Cura.ExpandablePopup
anchors.verticalCenter: parent.verticalCenter
}
MouseArea // Connection status tooltip hover area
{
id: tooltipHoverArea
anchors.fill: parent
hoverEnabled: tooltip.text != ""
acceptedButtons: Qt.NoButton // react to hover only, don't steal clicks
onEntered:
{
base.mouseArea.entered() // we want both this and the outer area to be entered
tooltip.show()
}
onExited: { tooltip.hide() }
}
Cura.ToolTip
{
id: tooltip
x: 0
y: parent.height + UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("tooltip").width
targetPoint: Qt.point(Math.round(extruderIcon.width / 2), 0)
text:
{
if (!model.enabled)
{
return ""
}
if (extruderItem.valueError)
{
return catalog.i18nc("@tooltip", "The configuration of this extruder is not allowed, and prohibits slicing.")
}
if (extruderItem.valueWarning)
{
return catalog.i18nc("@tooltip", "There are no profiles matching the configuration of this extruder.")
}
return ""
}
}
// Warning icon that indicates if no qualities are available for the variant/material combination for this extruder
UM.RecolorImage
{
id: badge
anchors
{
top: parent.top
topMargin: - Math.round(height * 1 / 6)
left: parent.left
leftMargin: extruderIcon.width - Math.round(width * 5 / 6)
}
width: UM.Theme.getSize("icon_indicator").width
height: UM.Theme.getSize("icon_indicator").height
visible: model.enabled && (extruderItem.valueError || extruderItem.valueWarning)
source:
{
if (extruderItem.valueError)
{
return UM.Theme.getIcon("ErrorBadge", "low")
}
if (extruderItem.valueWarning)
{
return UM.Theme.getIcon("WarningBadge", "low")
}
return ""
}
color:
{
if (extruderItem.valueError)
{
return UM.Theme.getColor("error")
}
if (extruderItem.valueWarning)
{
return UM.Theme.getColor("warning")
}
return "transparent"
}
// Make a themable circle in the background so we can change it in other themes
Rectangle
{
id: iconBackground
anchors.centerIn: parent
width: parent.width - 1.5 //1.5 pixels smaller, (at least sqrt(2), regardless of screen pixel scale) so that the circle doesn't show up behind the icon due to anti-aliasing.
height: parent.height - 1.5
radius: width / 2
z: parent.z - 1
color:
{
if (extruderItem.valueError)
{
return UM.Theme.getColor("error_badge_background")
}
if (extruderItem.valueWarning)
{
return UM.Theme.getColor("warning_badge_background")
}
return "transparent"
}
}
}
Column
{
opacity: model.enabled ? 1 : UM.Theme.getColor("extruder_disabled").a