Move Rotation "tooltip" out of cura.qml and make it useful for other tools as well

Tool hint is now a child of Toolbar.qml, where it fits with the tools for which it is useful.

CURA-1014
This commit is contained in:
fieldOfView 2016-04-12 17:09:32 +02:00
parent 967c062357
commit db7777a6e7
2 changed files with 23 additions and 20 deletions

View File

@ -487,6 +487,9 @@ UM.MainWindow
{
id: toolbar;
property int mouseX: base.mouseX
property int mouseY: base.mouseY
anchors {
top: openFileButton.bottom;
topMargin: UM.Theme.getSize("window_margin").height;
@ -522,26 +525,6 @@ UM.MainWindow
}
}
}
Rectangle
{
x: base.mouseX + UM.Theme.getSize("default_margin").width
y: base.mouseY + UM.Theme.getSize("default_margin").height
width: rotationLabel.width + UM.Theme.getSize("default_margin").width
height: rotationLabel.height;
color: UM.Theme.getColor("tooltip")
Label
{
id: rotationLabel
text: UM.ActiveTool.properties.getValue("Rotation") != undefined ? "%1°".arg(UM.ActiveTool.properties.getValue("Rotation")) : ""
color: UM.Theme.getColor("tooltip_text")
font: UM.Theme.getFont("default")
anchors.horizontalCenter: parent.horizontalCenter
}
visible: rotationLabel.text != "";
}
}
}

View File

@ -109,4 +109,24 @@ Item {
enabled: UM.Controller.toolsEnabled;
}
}
Rectangle
{
x: -base.x + base.mouseX + UM.Theme.getSize("default_margin").width
y: -base.y + base.mouseY + UM.Theme.getSize("default_margin").height
width: toolHint.width + UM.Theme.getSize("default_margin").width
height: toolHint.height;
color: UM.Theme.getColor("tooltip")
Label
{
id: toolHint
text: UM.ActiveTool.properties.getValue("ToolHint") != undefined ? UM.ActiveTool.properties.getValue("ToolHint") : ""
color: UM.Theme.getColor("tooltip_text")
font: UM.Theme.getFont("default")
anchors.horizontalCenter: parent.horizontalCenter
}
visible: toolHint.text != "";
}
}