mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-19 20:29:40 +08:00
Remove the show property from the tooltip
This was a bit of a weird setup, so i removed it. This way the tooltip can be used in the same way as the regular tooltip (by simply setting the visibility) CURA-6004
This commit is contained in:
parent
3f599bd06f
commit
0965d909c0
@ -115,6 +115,6 @@ Button
|
||||
Cura.ToolTip
|
||||
{
|
||||
id: tooltip
|
||||
show: button.hovered
|
||||
visible: button.hovered
|
||||
}
|
||||
}
|
@ -9,28 +9,25 @@ import Cura 1.0 as Cura
|
||||
|
||||
ToolTip
|
||||
{
|
||||
|
||||
enum ContentAlignment
|
||||
{
|
||||
AlignLeft,
|
||||
AlignRight
|
||||
}
|
||||
|
||||
// This property indicates when the tooltip has to show, for instance when a button is hovered
|
||||
property bool show: false
|
||||
|
||||
// Defines the alignment of the content, by default to the left
|
||||
property int contentAlignment: Cura.ToolTip.ContentAlignment.AlignRight
|
||||
|
||||
property alias tooltipText: tooltip.text
|
||||
property var targetPoint: Qt.point(parent.x, y + Math.round(height/2))
|
||||
|
||||
|
||||
id: tooltip
|
||||
text: ""
|
||||
delay: 500
|
||||
visible: text != "" && show
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
// If the text is not set, just set the height to 0 to prevent it from showing
|
||||
height: text != "" ? label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width: 0
|
||||
|
||||
x:
|
||||
{
|
||||
@ -43,7 +40,7 @@ ToolTip
|
||||
|
||||
y: Math.round(parent.height / 2 - label.height / 2 ) - padding
|
||||
|
||||
padding: 2
|
||||
padding: UM.Theme.getSize("thin_margin").width
|
||||
|
||||
background: UM.PointingRectangle
|
||||
{
|
||||
|
@ -101,6 +101,6 @@ Button
|
||||
{
|
||||
id: tooltip
|
||||
tooltipText: base.text
|
||||
show: base.hovered
|
||||
visible: base.hovered
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user