Skip to content

Commit f1bfc63

Browse files
committed
Add tooltip explaining extruder tab warning icons
1 parent 09b2fa3 commit f1bfc63

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

resources/qml/ExtruderTabs411.qml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ TabRow
113113

114114
status:
115115
{
116-
if (tabBar.hasMaterials || tabBar.hasVariants)
116+
if (model.enabled && (tabBar.hasMaterials || tabBar.hasVariants))
117117
{
118118
if (extruderStack != undefined && Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True")
119119
{
@@ -126,6 +126,38 @@ TabRow
126126
}
127127
return UM.StatusIcon.Status.NEUTRAL
128128
}
129+
130+
MouseArea // Connection status tooltip hover area
131+
{
132+
id: tooltipHoverArea
133+
anchors.fill: parent
134+
hoverEnabled: tooltip.text != ""
135+
acceptedButtons: Qt.NoButton // react to hover only, don't steal clicks
136+
137+
onEntered: tooltip.show()
138+
onExited: tooltip.hide()
139+
}
140+
141+
Cura.ToolTip
142+
{
143+
id: tooltip
144+
x: 0
145+
y: parent.height + UM.Theme.getSize("default_margin").height
146+
width: UM.Theme.getSize("tooltip").width
147+
targetPoint: Qt.point(Math.round(extruderIcon.width / 2), 0)
148+
text:
149+
{
150+
if (configurationWarning.status == UM.StatusIcon.Status.ERROR)
151+
{
152+
return catalog.i18nc("@tooltip", "The configuration of this extruder is not allowed, and prohibits slicing.")
153+
}
154+
if (configurationWarning.status == UM.StatusIcon.Status.WARNING)
155+
{
156+
return catalog.i18nc("@tooltip", "There are no profiles matching the configuration of this extruder.")
157+
}
158+
return ""
159+
}
160+
}
129161
}
130162
}
131163
onClicked:

0 commit comments

Comments
 (0)