mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-01 08:14:22 +08:00
Keep tooltip visible when hovering over it
Except when hovering over it while it's completely invisible. You just get this 100ms leeway time to transition from the setting to the tooltip.
This commit is contained in:
parent
96e631bfda
commit
d710d42c0a
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Copyright (c) 2020 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
@ -59,22 +59,39 @@ UM.PointingRectangle
|
||||
base.opacity = 0;
|
||||
}
|
||||
|
||||
Label
|
||||
MouseArea
|
||||
{
|
||||
id: label;
|
||||
anchors
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onHoveredChanged:
|
||||
{
|
||||
top: parent.top;
|
||||
topMargin: UM.Theme.getSize("tooltip_margins").height;
|
||||
left: parent.left;
|
||||
leftMargin: UM.Theme.getSize("tooltip_margins").width;
|
||||
right: parent.right;
|
||||
rightMargin: UM.Theme.getSize("tooltip_margins").width;
|
||||
if(containsMouse && base.opacity > 0)
|
||||
{
|
||||
base.show(Qt.point(base.x + base.width, base.y + UM.Theme.getSize("tooltip_arrow_margins").height));
|
||||
}
|
||||
else
|
||||
{
|
||||
base.hide();
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: label
|
||||
anchors
|
||||
{
|
||||
top: parent.top;
|
||||
topMargin: UM.Theme.getSize("tooltip_margins").height;
|
||||
left: parent.left;
|
||||
leftMargin: UM.Theme.getSize("tooltip_margins").width;
|
||||
right: parent.right;
|
||||
rightMargin: UM.Theme.getSize("tooltip_margins").width;
|
||||
}
|
||||
wrapMode: Text.Wrap;
|
||||
textFormat: Text.RichText
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("tooltip_text");
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
wrapMode: Text.Wrap;
|
||||
textFormat: Text.RichText
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("tooltip_text");
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user