mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 19:28:07 -06:00
Add tooltips for intent profiles to the Custom Quality panel.
The description is optional. Tooltip will not show if no description is set CURA-6853
This commit is contained in:
parent
3709cfa4ed
commit
b182830c21
3 changed files with 21 additions and 3 deletions
|
@ -37,7 +37,7 @@ class IntentCategoryModel(ListModel):
|
||||||
}
|
}
|
||||||
_translations["engineering"] = {
|
_translations["engineering"] = {
|
||||||
"name": catalog.i18nc("@label", "Engineering"),
|
"name": catalog.i18nc("@label", "Engineering"),
|
||||||
"description": catalog.i18nc("@text", "An profile which is suitable for engineering work")
|
"description": catalog.i18nc("@text", "A profile which is suitable for engineering work")
|
||||||
|
|
||||||
}
|
}
|
||||||
_translations["smooth"] = {
|
_translations["smooth"] = {
|
||||||
|
|
|
@ -70,12 +70,31 @@ Popup
|
||||||
{
|
{
|
||||||
id: headerLabel
|
id: headerLabel
|
||||||
text: model.name
|
text: model.name
|
||||||
|
color: UM.Theme.getColor("text_inactive")
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
|
width: parent.width
|
||||||
height: visible ? contentHeight: 0
|
height: visible ? contentHeight: 0
|
||||||
enabled: false
|
|
||||||
visible: qualitiesList.visibleChildren.length > 0
|
visible: qualitiesList.visibleChildren.length > 0
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
|
MouseArea // tooltip hover area
|
||||||
|
{
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
enabled: model.description !== undefined
|
||||||
|
acceptedButtons: Qt.NoButton // react to hover only, don't steal clicks
|
||||||
|
|
||||||
|
onEntered:
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
headerLabel,
|
||||||
|
Qt.point(- UM.Theme.getSize("default_margin").width, 0),
|
||||||
|
model.description
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onExited: base.hideTooltip()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column
|
Column
|
||||||
|
|
|
@ -173,7 +173,6 @@ Item
|
||||||
|
|
||||||
onEntered:
|
onEntered:
|
||||||
{
|
{
|
||||||
print(model.description)
|
|
||||||
base.showTooltip(
|
base.showTooltip(
|
||||||
intentCategoryLabel,
|
intentCategoryLabel,
|
||||||
Qt.point(-(intentCategoryLabel.x - qualityRow.x) - UM.Theme.getSize("thick_margin").width, 0),
|
Qt.point(-(intentCategoryLabel.x - qualityRow.x) - UM.Theme.getSize("thick_margin").width, 0),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue