diff --git a/UM/Qt/qml/UM/HelpIcon.qml b/UM/Qt/qml/UM/HelpIcon.qml new file mode 100644 index 000000000..dd34c262b --- /dev/null +++ b/UM/Qt/qml/UM/HelpIcon.qml @@ -0,0 +1,39 @@ +// Copyright (c) 2024 Ultimaker B.V. +// Uranium is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.3 + +import UM 1.8 as UM + +MouseArea +{ + property alias text: tooltip.text + property alias icon: image.source + + id: helpIconMouseArea + hoverEnabled: true + + implicitWidth: UM.Theme.getSize("section_icon").width + implicitHeight: UM.Theme.getSize("section_icon").height + + UM.ColorImage + { + id: image + anchors.fill: parent + color: UM.Theme.getColor("text") + source: UM.Theme.getIcon("Help") + + UM.ToolTip + { + UM.I18nCatalog { id: catalog; name: "cura" } + + id: tooltip + visible: helpIconMouseArea.containsMouse + targetPoint: Qt.point(parent.x + Math.round(parent.width / 2), parent.y) + x: 0 + y: parent.y + parent.height + UM.Theme.getSize("default_margin").height + width: UM.Theme.getSize("tooltip").width + } + } +} \ No newline at end of file diff --git a/UM/Qt/qml/UM/qmldir b/UM/Qt/qml/UM/qmldir index 163541e90..6299a9488 100644 --- a/UM/Qt/qml/UM/qmldir +++ b/UM/Qt/qml/UM/qmldir @@ -45,6 +45,7 @@ CategoryButton 1.5 CategoryButton.qml Switch 1.7 Switch.qml Slider 1.7 Slider.qml ComponentWithIcon 1.7 ComponentWithIcon.qml +HelpIcon 1.8 HelpIcon.qml # Validators FloatValidator 1.7 Validators/FloatValidator.qml