Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cura 11561 mockup pap #938

Merged
merged 6 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions UM/Qt/qml/UM/HelpIcon.qml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use a UM.TooltipArea?

{
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
}
}
}
1 change: 1 addition & 0 deletions UM/Qt/qml/UM/qmldir
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading