mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 05:09:00 +08:00
Fixes the tooltip placement for the view mode button
Fixes: issue CURA-152
This commit is contained in:
parent
bb961ad1b1
commit
aeb935489e
@ -368,6 +368,7 @@ UM.MainWindow
|
|||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
id: viewModeButton
|
id: viewModeButton
|
||||||
|
property bool verticalTooltip: true
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
top: parent.top;
|
top: parent.top;
|
||||||
|
@ -101,16 +101,29 @@ QtObject {
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: tool_button_background
|
id: tool_button_background
|
||||||
anchors.left: parent.right
|
anchors.left: control.verticalTooltip ? parent.left : parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: control.verticalTooltip ? undefined : parent.verticalCenter
|
||||||
//anchors.top: parent.bottom
|
anchors.top: control.verticalTooltip ? parent.bottom : undefined
|
||||||
|
|
||||||
//width: label.width > parent.width ? label.width : parent.width
|
|
||||||
width: control.hovered ? label.width : 0;
|
|
||||||
height: label.height
|
|
||||||
Behavior on width { NumberAnimation { duration: 100; } }
|
|
||||||
|
|
||||||
opacity: control.hovered ? 1.0 : 0.0;
|
opacity: control.hovered ? 1.0 : 0.0;
|
||||||
|
|
||||||
|
width: {
|
||||||
|
if (control.verticalTooltip == true){
|
||||||
|
if (label.width > parent.width)
|
||||||
|
return label.width
|
||||||
|
else
|
||||||
|
return parent.width
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (control.hovered)
|
||||||
|
return label.width
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
height: !control.verticalTooltip ? label.height : control.hovered ? label.height: 0
|
||||||
|
|
||||||
|
Behavior on width { NumberAnimation { duration: 100; } }
|
||||||
|
Behavior on height { NumberAnimation { duration: 100; } }
|
||||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user