Browse Source

Add tooltip in WorkspaceDialog over the printer selection drop down.

CURA-9424
Joey de l'Arago 2 years ago
parent
commit
c59f5a5c00
2 changed files with 53 additions and 27 deletions
  1. 1 3
      plugins/3MFReader/WorkspaceDialog.qml
  2. 52 24
      plugins/3MFReader/WorkspaceSection.qml

+ 1 - 3
plugins/3MFReader/WorkspaceDialog.qml

@@ -101,7 +101,7 @@ UM.Dialog
                     }
 
                     comboboxTitle: catalog.i18nc("@action:label", "Open With")
-                    comboboxTooltipText: catalog.i18nc("@info:tooltip", "How should the conflict in the machine be resolved?")
+                    comboboxTooltipText: catalog.i18nc("@info:tooltip", "Printer settings will be updated to match the settings saved with the project.")
                     comboboxVisible: workspaceDialog.visible && manager.updatableMachinesModel.count > 1
                     combobox: Cura.MachineSelector
                     {
@@ -188,7 +188,6 @@ UM.Dialog
                         }
                     }
 
-                    comboboxTooltipText: catalog.i18nc("@info:tooltip", "How should the conflict in the profile be resolved?")
                     comboboxVisible: manager.qualityChangesConflict
                     combobox: Cura.ComboBox
                     {
@@ -231,7 +230,6 @@ UM.Dialog
                         }
                     }
 
-                    comboboxTooltipText: catalog.i18nc("@info:tooltip", "How should the conflict in the material be resolved?")
                     comboboxVisible: manager.materialConflict
 
                     combobox: Cura.ComboBox

+ 52 - 24
plugins/3MFReader/WorkspaceSection.qml

@@ -23,7 +23,31 @@ Item
     height: childrenRect.height
     anchors.leftMargin: UM.Theme.getSize("default_margin").width
 
-    UM.TooltipArea
+    Row
+    {
+        id: sectionTitleRow
+        anchors.top: parent.top
+        bottomPadding: UM.Theme.getSize("default_margin").height
+        spacing: UM.Theme.getSize("default_margin").width
+
+        UM.ColorImage
+        {
+            id: sectionTitleIcon
+            anchors.verticalCenter: parent.verticalCenter
+            source: ""
+            height: UM.Theme.getSize("medium_button_icon").height
+            width: height
+        }
+        UM.Label
+        {
+            id: sectionTitle
+            text: ""
+            anchors.verticalCenter: parent.verticalCenter
+            font: UM.Theme.getFont("default_bold")
+        }
+    }
+
+    Item
     {
         id: comboboxTooltip
         width: (parent.width / 2.5) | 0
@@ -31,8 +55,6 @@ Item
         anchors.top: parent.top
         anchors.right: parent.right
         anchors.rightMargin: UM.Theme.getSize("default_margin").width
-
-        text: comboboxTooltipText
         visible: comboboxVisible
 
         UM.Label
@@ -56,32 +78,38 @@ Item
             anchors.left: parent.left
             sourceComponent: combobox
         }
-    }
 
-    Row
-    {
-        id: sectionTitleRow
-        anchors.top: parent.top
-        bottomPadding: UM.Theme.getSize("default_margin").height
-        spacing: UM.Theme.getSize("default_margin").width
-
-        UM.ColorImage
+        MouseArea
         {
-            id: sectionTitleIcon
-            anchors.verticalCenter: parent.verticalCenter
-            source: ""
-            height: UM.Theme.getSize("medium_button_icon").height
-            width: height
-        }
-        UM.Label
-        {
-            id: sectionTitle
-            text: ""
-            anchors.verticalCenter: parent.verticalCenter
-            font: UM.Theme.getFont("default_bold")
+            id: helpIconMouseArea
+            anchors.right: parent.right
+            anchors.verticalCenter: comboboxLabel.verticalCenter
+            width: childrenRect.width
+            height: childrenRect.height
+            hoverEnabled: true
+
+            UM.ColorImage
+            {
+                width: UM.Theme.getSize("section_icon").width
+                height: width
+
+                visible: comboboxTooltipText != ""
+                source: UM.Theme.getIcon("Help")
+
+                UM.ToolTip
+                {
+                    text: comboboxTooltipText
+                    visible: helpIconMouseArea.containsMouse
+                    targetPoint: Qt.point(parent.x + Math.round(parent.width / 2), parent.y)
+                    x: 0
+                    y: parent.y + parent.height + UM.Theme.getSize("default_margin").height
+                    width: UM.Theme.getSize("tooltip").width
+                }
+            }
         }
     }
 
+
     Loader
     {
         width: parent.width