Browse Source

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
fieldOfView 9 years ago
parent
commit
db7777a6e7
2 changed files with 23 additions and 20 deletions
  1. 3 20
      resources/qml/Cura.qml
  2. 20 0
      resources/qml/Toolbar.qml

+ 3 - 20
resources/qml/Cura.qml

@@ -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 != "";
-            }
         }
     }
 

+ 20 - 0
resources/qml/Toolbar.qml

@@ -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 != "";
+    }
 }