LinearGradient is not available for 2d shapes in QT6

Replace LinearGradient with Gradient in preview color scheme drop down

CURA-8640
This commit is contained in:
j.delarago 2022-04-06 10:50:33 +02:00
parent c88ed076a1
commit 00c7c37b34
2 changed files with 86 additions and 130 deletions

View file

@ -1,7 +1,7 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.4
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1
@ -483,23 +483,9 @@ Cura.ExpandableComponent
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
LinearGradient
{
anchors
{
left: parent.left
leftMargin: UM.Theme.getSize("default_lining").width
right: parent.right
rightMargin: UM.Theme.getSize("default_lining").width
top: parent.top
topMargin: UM.Theme.getSize("default_lining").width
bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_lining").width
}
start: Qt.point(0, 0)
end: Qt.point(parent.width, 0)
gradient: Gradient
{
orientation: Gradient.Horizontal
GradientStop
{
position: 0.000
@ -522,7 +508,6 @@ Cura.ExpandableComponent
}
}
}
}
// Gradient colors for layer thickness (similar to parula colormap)
Rectangle
@ -537,23 +522,9 @@ Cura.ExpandableComponent
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
LinearGradient
{
anchors
{
left: parent.left
leftMargin: UM.Theme.getSize("default_lining").width
right: parent.right
rightMargin: UM.Theme.getSize("default_lining").width
top: parent.top
topMargin: UM.Theme.getSize("default_lining").width
bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_lining").width
}
start: Qt.point(0, 0)
end: Qt.point(parent.width, 0)
gradient: Gradient
{
orientation: Gradient.Horizontal
GradientStop
{
position: 0.000
@ -581,7 +552,6 @@ Cura.ExpandableComponent
}
}
}
}
// Gradient colors for flow (similar to jet colormap)
Rectangle
@ -596,23 +566,9 @@ Cura.ExpandableComponent
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
LinearGradient
{
anchors
{
left: parent.left
leftMargin: UM.Theme.getSize("default_lining").width
right: parent.right
rightMargin: UM.Theme.getSize("default_lining").width
top: parent.top
topMargin: UM.Theme.getSize("default_lining").width
bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_lining").width
}
start: Qt.point(0, 0)
end: Qt.point(parent.width, 0)
gradient: Gradient
{
orientation: Gradient.Horizontal
GradientStop
{
position: 0.0
@ -661,7 +617,6 @@ Cura.ExpandableComponent
}
}
}
}
FontMetrics
{

View file

@ -1,3 +1,4 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.