mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 14:55:03 -06:00
Fixes the tooltip placement for the view mode button
Fixes: issue CURA-152
This commit is contained in:
parent
bb961ad1b1
commit
aeb935489e
2 changed files with 23 additions and 9 deletions
|
@ -368,6 +368,7 @@ UM.MainWindow
|
|||
Button
|
||||
{
|
||||
id: viewModeButton
|
||||
property bool verticalTooltip: true
|
||||
anchors
|
||||
{
|
||||
top: parent.top;
|
||||
|
|
|
@ -101,16 +101,29 @@ QtObject {
|
|||
|
||||
Rectangle {
|
||||
id: tool_button_background
|
||||
anchors.left: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
//anchors.top: parent.bottom
|
||||
|
||||
//width: label.width > parent.width ? label.width : parent.width
|
||||
width: control.hovered ? label.width : 0;
|
||||
height: label.height
|
||||
Behavior on width { NumberAnimation { duration: 100; } }
|
||||
|
||||
anchors.left: control.verticalTooltip ? parent.left : parent.right
|
||||
anchors.verticalCenter: control.verticalTooltip ? undefined : parent.verticalCenter
|
||||
anchors.top: control.verticalTooltip ? parent.bottom : undefined
|
||||
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; } }
|
||||
|
||||
Label {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue