Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorj.delarago <joeydelarago@gmail.com>2022-03-03 17:53:30 +0300
committerj.delarago <joeydelarago@gmail.com>2022-03-03 17:53:30 +0300
commit3c7498feed99d85eb11e4dd859753e3c97a74f28 (patch)
treec6124648a3a015791ace79a9aa357a62073cafae
parent901dc55733bc8c7b7ccc6bcb61059c566a89f841 (diff)
Move ToolbarButton and ToolTip from Cura into Uranium. This makes it possible to use new styled ToolbarButton in plugins/Tools for the rotate tool.
Removed the ContentAlignment enum in ToolTip in favour of using the Text.ContentAlignment enum. For some reason references to this enum fail everywhere when ToolTip is moved into Uranium. There is some evil time-wasting magic cast on this component! CURA-8943
-rw-r--r--plugins/ImageReader/ConfigUI.qml16
-rw-r--r--plugins/Marketplace/resources/qml/ManagePackagesButton.qml4
-rw-r--r--plugins/Marketplace/resources/qml/PackageDetails.qml4
-rw-r--r--plugins/Marketplace/resources/qml/VerifiedIcon.qml2
-rw-r--r--plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml8
-rw-r--r--plugins/PostProcessingPlugin/PostProcessingPlugin.qml2
-rw-r--r--resources/qml/ActionButton.qml2
-rw-r--r--resources/qml/ActionPanel/OutputProcessWidget.qml4
-rw-r--r--resources/qml/ApplicationSwitcher/ApplicationButton.qml2
-rw-r--r--resources/qml/ExtruderButton.qml4
-rw-r--r--resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml2
-rw-r--r--resources/qml/ObjectItemButton.qml2
-rw-r--r--resources/qml/PrintSetupHeaderButton.qml2
-rw-r--r--resources/qml/PrinterSelector/MachineSelector.qml2
-rw-r--r--resources/qml/ToolTip.qml82
-rw-r--r--resources/qml/Toolbar.qml4
-rw-r--r--resources/qml/ToolbarButton.qml110
-rw-r--r--resources/qml/qmldir2
18 files changed, 30 insertions, 224 deletions
diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml
index ff79e4e31d..28fd1f9106 100644
--- a/plugins/ImageReader/ConfigUI.qml
+++ b/plugins/ImageReader/ConfigUI.qml
@@ -51,7 +51,7 @@ UM.Dialog
onTextChanged: manager.onPeakHeightChanged(text)
}
- Cura.ToolTip
+ UM.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The maximum distance of each pixel from \"Base.\"")
visible: peak_height.hovered || peak_height_label.containsMouse
@@ -85,7 +85,7 @@ UM.Dialog
onTextChanged: manager.onBaseHeightChanged(text)
}
- Cura.ToolTip
+ UM.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The base height from the build plate in millimeters.")
visible: base_height.hovered || base_height_label.containsMouse
@@ -119,7 +119,7 @@ UM.Dialog
onTextChanged: manager.onWidthChanged(text)
}
- Cura.ToolTip
+ UM.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The width in millimeters on the build plate")
visible: width.hovered || width_label.containsMouse
@@ -153,7 +153,7 @@ UM.Dialog
onTextChanged: manager.onDepthChanged(text)
}
- Cura.ToolTip
+ UM.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The depth in millimeters on the build plate")
visible: depth.hovered || depth_label.containsMouse
@@ -190,7 +190,7 @@ UM.Dialog
onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) }
}
- Cura.ToolTip
+ UM.ToolTip
{
text: catalog.i18nc("@info:tooltip", "For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.")
visible: lighter_is_higher.hovered || lighter_is_higher_label.containsMouse
@@ -227,7 +227,7 @@ UM.Dialog
onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) }
}
- Cura.ToolTip
+ UM.ToolTip
{
text: catalog.i18nc("@info:tooltip", "For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.")
visible: color_model.hovered || color_model_label.containsMouse
@@ -258,7 +258,7 @@ UM.Dialog
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
onTextChanged: manager.onTransmittanceChanged(text)
- Cura.ToolTip
+ UM.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.")
visible: parent.hovered || transmittance_label.containsMouse
@@ -293,7 +293,7 @@ UM.Dialog
onValueChanged: manager.onSmoothingChanged(value)
}
- Cura.ToolTip
+ UM.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The amount of smoothing to apply to the image.")
visible: smoothing.hovered || smoothing_label.containsMouse
diff --git a/plugins/Marketplace/resources/qml/ManagePackagesButton.qml b/plugins/Marketplace/resources/qml/ManagePackagesButton.qml
index 92e2196beb..fc9e7d757f 100644
--- a/plugins/Marketplace/resources/qml/ManagePackagesButton.qml
+++ b/plugins/Marketplace/resources/qml/ManagePackagesButton.qml
@@ -1,7 +1,7 @@
// Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
-import UM 1.2 as UM
+import UM 1.5 as UM
import Cura 1.6 as Cura
import QtQuick 2.15
@@ -25,7 +25,7 @@ TabButton
radius: Math.round(width * 0.5)
}
- Cura.ToolTip
+ UM.ToolTip
{
id: tooltip
diff --git a/plugins/Marketplace/resources/qml/PackageDetails.qml b/plugins/Marketplace/resources/qml/PackageDetails.qml
index 2599c7f28c..4bf32c53d7 100644
--- a/plugins/Marketplace/resources/qml/PackageDetails.qml
+++ b/plugins/Marketplace/resources/qml/PackageDetails.qml
@@ -6,7 +6,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.3
import Cura 1.0 as Cura
-import UM 1.0 as UM
+import UM 1.5 as UM
Item
{
@@ -38,7 +38,7 @@ Item
onClicked: contextStack.pop() //Remove this page, returning to the main package list or whichever thing is beneath it.
tooltip: catalog.i18nc("@button:tooltip", "Back")
- toolTipContentAlignment: Cura.ToolTip.ContentAlignment.AlignRight
+ toolTipContentAlignment: Text.AlignRight
leftPadding: UM.Theme.getSize("narrow_margin").width
rightPadding: leftPadding
iconSource: UM.Theme.getIcon("ArrowLeft")
diff --git a/plugins/Marketplace/resources/qml/VerifiedIcon.qml b/plugins/Marketplace/resources/qml/VerifiedIcon.qml
index 30ef3080a0..6b9d7b6017 100644
--- a/plugins/Marketplace/resources/qml/VerifiedIcon.qml
+++ b/plugins/Marketplace/resources/qml/VerifiedIcon.qml
@@ -12,7 +12,7 @@ Control
implicitWidth: UM.Theme.getSize("card_tiny_icon").width
implicitHeight: UM.Theme.getSize("card_tiny_icon").height
- Cura.ToolTip
+ UM.ToolTip
{
tooltipText:
{
diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml
index 03e1da7d35..17bdee2618 100644
--- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml
+++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml
@@ -75,7 +75,7 @@ Item
id: meshTypeButtons
spacing: UM.Theme.getSize("default_margin").width
- Cura.ToolbarButton
+ UM.ToolbarButton
{
id: normalButton
text: catalog.i18nc("@label", "Normal model")
@@ -90,7 +90,7 @@ Item
z: 4
}
- Cura.ToolbarButton
+ UM.ToolbarButton
{
id: supportMeshButton
text: catalog.i18nc("@label", "Print as support")
@@ -105,7 +105,7 @@ Item
z: 3
}
- Cura.ToolbarButton
+ UM.ToolbarButton
{
id: overlapMeshButton
text: catalog.i18nc("@label", "Modify settings for overlaps")
@@ -120,7 +120,7 @@ Item
z: 2
}
- Cura.ToolbarButton
+ UM.ToolbarButton
{
id: antiOverhangMeshButton
text: catalog.i18nc("@label", "Don't support overlaps")
diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml
index 9c59f9e879..7bb179e8ed 100644
--- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml
+++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml
@@ -479,7 +479,7 @@ UM.Dialog
}
return tipText
}
- toolTipContentAlignment: Cura.ToolTip.ContentAlignment.AlignLeft
+ toolTipContentAlignment: Text.AlignLeft
onClicked: dialog.show()
iconSource: "Script.svg"
fixedWidthMode: false
diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml
index e866260158..5cec567ae4 100644
--- a/resources/qml/ActionButton.qml
+++ b/resources/qml/ActionButton.qml
@@ -179,7 +179,7 @@ Button
cornerSide: Cura.RoundedRectangle.Direction.None
}
- Cura.ToolTip
+ UM.ToolTip
{
id: tooltip
visible:
diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml
index 6e412c9a04..13c910d9cc 100644
--- a/resources/qml/ActionPanel/OutputProcessWidget.qml
+++ b/resources/qml/ActionPanel/OutputProcessWidget.qml
@@ -5,7 +5,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
-import UM 1.1 as UM
+import UM 1.5 as UM
import Cura 1.0 as Cura
@@ -128,7 +128,7 @@ Column
tooltip: text
fixedWidthMode: true
- toolTipContentAlignment: Cura.ToolTip.ContentAlignment.AlignLeft
+ toolTipContentAlignment: Text.AlignLeft
onClicked: UM.Controller.setActiveStage("PreviewStage")
}
diff --git a/resources/qml/ApplicationSwitcher/ApplicationButton.qml b/resources/qml/ApplicationSwitcher/ApplicationButton.qml
index 0384ca2ed5..182b80811b 100644
--- a/resources/qml/ApplicationSwitcher/ApplicationButton.qml
+++ b/resources/qml/ApplicationSwitcher/ApplicationButton.qml
@@ -31,7 +31,7 @@ Button
border.width: UM.Theme.getSize("default_lining").width
}
- Cura.ToolTip
+ UM.ToolTip
{
id: tooltip
tooltipText: base.text
diff --git a/resources/qml/ExtruderButton.qml b/resources/qml/ExtruderButton.qml
index b87855e25e..204e9a5469 100644
--- a/resources/qml/ExtruderButton.qml
+++ b/resources/qml/ExtruderButton.qml
@@ -4,10 +4,10 @@
import QtQuick 2.2
import QtQuick.Controls 2.0
-import UM 1.2 as UM
+import UM 1.5 as UM
import Cura 1.0 as Cura
-Cura.ToolbarButton
+UM.ToolbarButton
{
id: base
diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml
index 6f7ee90733..f0b6e14683 100644
--- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml
+++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml
@@ -83,7 +83,7 @@ Cura.ExpandablePopup
onExited: { tooltip.hide() }
}
- Cura.ToolTip
+ UM.ToolTip
{
id: tooltip
x: 0
diff --git a/resources/qml/ObjectItemButton.qml b/resources/qml/ObjectItemButton.qml
index 73295b2e69..c3066b800d 100644
--- a/resources/qml/ObjectItemButton.qml
+++ b/resources/qml/ObjectItemButton.qml
@@ -188,7 +188,7 @@ Button
elideWidth: buttonText.width
}
- Cura.ToolTip
+ UM.ToolTip
{
id: tooltip
tooltipText: objectItemButton.text + perObjectSettingsInfo.tooltipText
diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml
index e41f95f778..e9b76a763f 100644
--- a/resources/qml/PrintSetupHeaderButton.qml
+++ b/resources/qml/PrintSetupHeaderButton.qml
@@ -19,7 +19,7 @@ ToolButton
property bool valueError: false;
property bool valueWarning: false;
- Cura.ToolTip
+ UM.ToolTip
{
id: tooltip
visible: base.hovered
diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml
index 8bea52fab6..12f495f7a8 100644
--- a/resources/qml/PrinterSelector/MachineSelector.qml
+++ b/resources/qml/PrinterSelector/MachineSelector.qml
@@ -172,7 +172,7 @@ Cura.ExpandablePopup
onExited: { tooltip.hide() }
}
- Cura.ToolTip
+ UM.ToolTip
{
id: tooltip
diff --git a/resources/qml/ToolTip.qml b/resources/qml/ToolTip.qml
deleted file mode 100644
index f02bf0b50f..0000000000
--- a/resources/qml/ToolTip.qml
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2018 Ultimaker B.V.
-// Cura is released under the terms of the LGPLv3 or higher.
-
-import QtQuick 2.7
-import QtQuick.Controls 2.3
-
-import UM 1.5 as UM
-import Cura 1.0 as Cura
-
-ToolTip
-{
- enum ContentAlignment
- {
- AlignLeft,
- AlignRight
- }
-
- // Defines the alignment of the content, by default to the left
- property int contentAlignment: Cura.ToolTip.ContentAlignment.AlignRight
-
- property alias tooltipText: tooltip.text
- property alias arrowSize: backgroundRect.arrowSize
- property var targetPoint: Qt.point(parent.x, y + Math.round(height/2))
-
- id: tooltip
- text: ""
- delay: 500
- font: UM.Theme.getFont("default")
- visible: opacity != 0.0
- opacity: 0.0 // initially hidden
-
- Behavior on opacity
- {
- NumberAnimation { duration: 100; }
- }
-
- onAboutToShow: show()
- onAboutToHide: hide()
-
- // If the text is not set, just set the height to 0 to prevent it from showing
- height: label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width
-
- x:
- {
- if (contentAlignment == Cura.ToolTip.ContentAlignment.AlignLeft)
- {
- return (label.width + Math.round(UM.Theme.getSize("default_arrow").width * 1.2) + padding * 2) * -1
- }
- return parent.width + Math.round(UM.Theme.getSize("default_arrow").width * 1.2 + padding)
- }
-
- y: Math.round(parent.height / 2 - label.height / 2 ) - padding
-
- padding: UM.Theme.getSize("thin_margin").width
-
- background: UM.PointingRectangle
- {
- id: backgroundRect
- color: UM.Theme.getColor("tooltip")
- target: Qt.point(targetPoint.x - tooltip.x, targetPoint.y - tooltip.y)
- arrowSize: UM.Theme.getSize("default_arrow").width
- visible: tooltip.height != 0
- }
-
- contentItem: UM.Label
- {
- id: label
- text: tooltip.text
- font: tooltip.font
- wrapMode: Text.Wrap
- textFormat: Text.RichText
- color: UM.Theme.getColor("tooltip_text")
- }
-
- function show() {
- opacity = text != "" ? 1 : 0
- }
-
- function hide() {
- opacity = 0
- }
-} \ No newline at end of file
diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml
index 66163fed37..2b79f22957 100644
--- a/resources/qml/Toolbar.qml
+++ b/resources/qml/Toolbar.qml
@@ -4,7 +4,7 @@
import QtQuick 2.2
import QtQuick.Controls 2.3
-import UM 1.2 as UM
+import UM 1.5 as UM
import Cura 1.0 as Cura
Item
@@ -53,7 +53,7 @@ Item
width: childrenRect.width
height: childrenRect.height
- delegate: ToolbarButton
+ delegate: UM.ToolbarButton
{
text: model.name + (model.shortcut ? (" (" + model.shortcut + ")") : "")
checkable: true
diff --git a/resources/qml/ToolbarButton.qml b/resources/qml/ToolbarButton.qml
deleted file mode 100644
index 206ab23dc4..0000000000
--- a/resources/qml/ToolbarButton.qml
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright (c) 2018 Ultimaker B.V.
-// Cura is released under the terms of the LGPLv3 or higher.
-
-import QtQuick 2.7
-import QtQuick.Controls 2.3
-
-import UM 1.2 as UM
-import Cura 1.0 as Cura
-
-Button
-{
- id: base
-
- property alias toolItem: contentItemLoader.sourceComponent
-
- // These two properties indicate whether the toolbar button is at the top of the toolbar column or at the bottom.
- // If it is somewhere in the middle, then both has to be false. If there is only one element in the column, then
- // both properties have to be set to true. This is used to create a rounded corner.
- property bool isTopElement: false
- property bool isBottomElement: false
-
- hoverEnabled: true
-
- background: Rectangle
- {
- implicitWidth: UM.Theme.getSize("button").width
- implicitHeight: UM.Theme.getSize("button").height
- color: UM.Theme.getColor("toolbar_background")
- radius: UM.Theme.getSize("default_radius").width
-
- Rectangle
- {
- id: topSquare
- anchors
- {
- left: parent.left
- right: parent.right
- top: parent.top
- }
- height: parent.radius
- color: parent.color
- visible: !base.isTopElement
- }
-
- Rectangle
- {
- id: bottomSquare
- anchors
- {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- height: parent.radius
- color: parent.color
- visible: !base.isBottomElement
- }
-
- Rectangle
- {
- id: leftSquare
- anchors
- {
- left: parent.left
- top: parent.top
- bottom: parent.bottom
- }
- width: parent.radius
- color: parent.color
- }
- }
- contentItem: Rectangle
- {
- opacity: parent.enabled ? 1.0 : 0.2
- implicitWidth: Math.round(UM.Theme.getSize("button").width * 0.75)
- implicitHeight: Math.round(UM.Theme.getSize("button").height * 0.75)
- radius: Math.round(width * 0.5)
-
- color:
- {
- if (base.checked && base.hovered)
- {
- return UM.Theme.getColor("toolbar_button_active_hover")
- }
- else if (base.checked)
- {
- return UM.Theme.getColor("toolbar_button_active")
- }
- else if(base.hovered)
- {
- return UM.Theme.getColor("toolbar_button_hover")
- }
- return UM.Theme.getColor("toolbar_background")
- }
- Loader
- {
- id: contentItemLoader
- anchors.centerIn: parent
- width: Math.round(UM.Theme.getSize("button").width / 2)
- height: Math.round(UM.Theme.getSize("button").height / 2)
- }
- }
-
- Cura.ToolTip
- {
- id: tooltip
- tooltipText: base.text
- visible: base.hovered
- }
-}
diff --git a/resources/qml/qmldir b/resources/qml/qmldir
index 8ddacc56e4..a47d85545b 100644
--- a/resources/qml/qmldir
+++ b/resources/qml/qmldir
@@ -14,10 +14,8 @@ OutputDevicesActionButton 1.0 OutputDevicesActionButton.qml
ExpandableComponent 1.0 ExpandableComponent.qml
PrinterTypeLabel 1.0 PrinterTypeLabel.qml
ViewsSelector 1.0 ViewsSelector.qml
-ToolbarButton 1.0 ToolbarButton.qml
SettingView 1.0 SettingView.qml
ProfileMenu 1.0 ProfileMenu.qml
-ToolTip 1.0 ToolTip.qml
# Cura/WelcomePages