Use stylised tooltip for pre-heat button

Took some figuring out, this one... But it works.

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-10 14:40:31 +01:00
parent be5b656ef7
commit b3bd488c07
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -315,7 +315,6 @@ Column
Button //The pre-heat button.
{
id: preheatButton
tooltip: catalog.i18nc("@tooltip of pre-heat", "Heat the bed in advance before printing. You can continue adjusting your print while it is heating, and you won't have to wait for the bed to heat up when you're ready to print.")
height: UM.Theme.getSize("setting_control").height
enabled:
{
@ -447,6 +446,22 @@ Column
preheatCountdownTimer.update();
}
}
onHoveredChanged:
{
if (hovered)
{
base.showTooltip(
base,
{x: 0, y: preheatButton.mapToItem(base, 0, 0).y},
catalog.i18nc("@tooltip of pre-heat", "Heat the bed in advance before printing. You can continue adjusting your print while it is heating, and you won't have to wait for the bed to heat up when you're ready to print.")
);
}
else
{
base.hideTooltip();
}
}
}
}