Align tooltips better

We want the tooltip area to point at the vertical centre. However, we want the tooltip of pure text elements to point at the vertical centre between the base line and the middle line (centre of lowercase letters). Therefore the offset for those elements is a quarter of the height rather than half (which is good enough of an approximation).

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-16 15:02:48 +01:00
parent b77e5f5d0c
commit f956436c32
No known key found for this signature in database
GPG Key ID: C5F96EE2BC0F7E75

View File

@ -115,7 +115,7 @@ Column
{ {
base.showTooltip( base.showTooltip(
base, base,
{x: 0, y: parent.mapToItem(base, 0, 0).y}, {x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y},
catalog.i18nc("@tooltip", "The current temperature of this extruder.") catalog.i18nc("@tooltip", "The current temperature of this extruder.")
); );
} }
@ -150,7 +150,7 @@ Column
{ {
base.showTooltip( base.showTooltip(
base, base,
{x: 0, y: parent.mapToItem(base, 0, 0).y}, {x: 0, y: parent.mapToItem(base, 0, -parent.height / 2).y},
catalog.i18nc("@tooltip", "The colour of the material in this extruder.") catalog.i18nc("@tooltip", "The colour of the material in this extruder.")
); );
} }
@ -214,7 +214,7 @@ Column
{ {
base.showTooltip( base.showTooltip(
base, base,
{x: 0, y: parent.mapToItem(base, 0, 0).y}, {x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y},
catalog.i18nc("@tooltip", "The nozzle inserted in this extruder.") catalog.i18nc("@tooltip", "The nozzle inserted in this extruder.")
); );
} }
@ -274,7 +274,7 @@ Column
{ {
base.showTooltip( base.showTooltip(
base, base,
{x: 0, y: bedTargetTemperature.mapToItem(base, 0, 0).y}, {x: 0, y: bedTargetTemperature.mapToItem(base, 0, -parent.height / 4).y},
catalog.i18nc("@tooltip", "The target temperature of the heated bed. The bed will heat up or cool down towards this temperature. If this is 0, the bed heating is turned off.") catalog.i18nc("@tooltip", "The target temperature of the heated bed. The bed will heat up or cool down towards this temperature. If this is 0, the bed heating is turned off.")
); );
} }
@ -306,7 +306,7 @@ Column
{ {
base.showTooltip( base.showTooltip(
base, base,
{x: 0, y: bedCurrentTemperature.mapToItem(base, 0, 0).y}, {x: 0, y: bedCurrentTemperature.mapToItem(base, 0, -parent.height / 4).y},
catalog.i18nc("@tooltip", "The current temperature of the heated bed.") catalog.i18nc("@tooltip", "The current temperature of the heated bed.")
); );
} }