mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
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:
parent
c88ed076a1
commit
00c7c37b34
2 changed files with 86 additions and 130 deletions
|
@ -1,7 +1,7 @@
|
||||||
// Copyright (c) 2022 Ultimaker B.V.
|
// Copyright (c) 2022 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// 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.Layouts 1.1
|
||||||
import QtQuick.Controls 2.1
|
import QtQuick.Controls 2.1
|
||||||
|
|
||||||
|
@ -483,43 +483,28 @@ Cura.ExpandableComponent
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: UM.Theme.getColor("lining")
|
border.color: UM.Theme.getColor("lining")
|
||||||
|
|
||||||
LinearGradient
|
gradient: Gradient
|
||||||
{
|
{
|
||||||
anchors
|
orientation: Gradient.Horizontal
|
||||||
|
GradientStop
|
||||||
{
|
{
|
||||||
left: parent.left
|
position: 0.000
|
||||||
leftMargin: UM.Theme.getSize("default_lining").width
|
color: Qt.rgba(0, 0, 1, 1)
|
||||||
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)
|
GradientStop
|
||||||
end: Qt.point(parent.width, 0)
|
|
||||||
gradient: Gradient
|
|
||||||
{
|
{
|
||||||
GradientStop
|
position: 0.25
|
||||||
{
|
color: Qt.rgba(0.25, 1, 0, 1)
|
||||||
position: 0.000
|
}
|
||||||
color: Qt.rgba(0, 0, 1, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.375
|
||||||
{
|
color: Qt.rgba(0.375, 0.5, 0, 1)
|
||||||
position: 0.25
|
}
|
||||||
color: Qt.rgba(0.25, 1, 0, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 1.0
|
||||||
{
|
color: Qt.rgba(1, 0.5, 0, 1)
|
||||||
position: 0.375
|
|
||||||
color: Qt.rgba(0.375, 0.5, 0, 1)
|
|
||||||
}
|
|
||||||
GradientStop
|
|
||||||
{
|
|
||||||
position: 1.0
|
|
||||||
color: Qt.rgba(1, 0.5, 0, 1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -537,48 +522,33 @@ Cura.ExpandableComponent
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: UM.Theme.getColor("lining")
|
border.color: UM.Theme.getColor("lining")
|
||||||
|
|
||||||
LinearGradient
|
gradient: Gradient
|
||||||
{
|
{
|
||||||
anchors
|
orientation: Gradient.Horizontal
|
||||||
|
GradientStop
|
||||||
{
|
{
|
||||||
left: parent.left
|
position: 0.000
|
||||||
leftMargin: UM.Theme.getSize("default_lining").width
|
color: Qt.rgba(0, 0, 0.5, 1)
|
||||||
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)
|
GradientStop
|
||||||
end: Qt.point(parent.width, 0)
|
|
||||||
gradient: Gradient
|
|
||||||
{
|
{
|
||||||
GradientStop
|
position: 0.25
|
||||||
{
|
color: Qt.rgba(0, 0.375, 0.75, 1)
|
||||||
position: 0.000
|
}
|
||||||
color: Qt.rgba(0, 0, 0.5, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.5
|
||||||
{
|
color: Qt.rgba(0, 0.75, 0.5, 1)
|
||||||
position: 0.25
|
}
|
||||||
color: Qt.rgba(0, 0.375, 0.75, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.75
|
||||||
{
|
color: Qt.rgba(1, 0.75, 0.25, 1)
|
||||||
position: 0.5
|
}
|
||||||
color: Qt.rgba(0, 0.75, 0.5, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 1.0
|
||||||
{
|
color: Qt.rgba(1, 1, 0, 1)
|
||||||
position: 0.75
|
|
||||||
color: Qt.rgba(1, 0.75, 0.25, 1)
|
|
||||||
}
|
|
||||||
GradientStop
|
|
||||||
{
|
|
||||||
position: 1.0
|
|
||||||
color: Qt.rgba(1, 1, 0, 1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -596,68 +566,53 @@ Cura.ExpandableComponent
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: UM.Theme.getColor("lining")
|
border.color: UM.Theme.getColor("lining")
|
||||||
|
|
||||||
LinearGradient
|
gradient: Gradient
|
||||||
{
|
{
|
||||||
anchors
|
orientation: Gradient.Horizontal
|
||||||
|
GradientStop
|
||||||
{
|
{
|
||||||
left: parent.left
|
position: 0.0
|
||||||
leftMargin: UM.Theme.getSize("default_lining").width
|
color: Qt.rgba(0, 0, 0.5, 1)
|
||||||
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)
|
GradientStop
|
||||||
end: Qt.point(parent.width, 0)
|
|
||||||
gradient: Gradient
|
|
||||||
{
|
{
|
||||||
GradientStop
|
position: 0.125
|
||||||
{
|
color: Qt.rgba(0, 0.0, 1.0, 1)
|
||||||
position: 0.0
|
}
|
||||||
color: Qt.rgba(0, 0, 0.5, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.25
|
||||||
{
|
color: Qt.rgba(0, 0.5, 1.0, 1)
|
||||||
position: 0.125
|
}
|
||||||
color: Qt.rgba(0, 0.0, 1.0, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.375
|
||||||
{
|
color: Qt.rgba(0.0, 1.0, 1.0, 1)
|
||||||
position: 0.25
|
}
|
||||||
color: Qt.rgba(0, 0.5, 1.0, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.5
|
||||||
{
|
color: Qt.rgba(0.5, 1.0, 0.5, 1)
|
||||||
position: 0.375
|
}
|
||||||
color: Qt.rgba(0.0, 1.0, 1.0, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.625
|
||||||
{
|
color: Qt.rgba(1.0, 1.0, 0.0, 1)
|
||||||
position: 0.5
|
}
|
||||||
color: Qt.rgba(0.5, 1.0, 0.5, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.75
|
||||||
{
|
color: Qt.rgba(1.0, 0.5, 0, 1)
|
||||||
position: 0.625
|
}
|
||||||
color: Qt.rgba(1.0, 1.0, 0.0, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 0.875
|
||||||
{
|
color: Qt.rgba(1.0, 0.0, 0, 1)
|
||||||
position: 0.75
|
}
|
||||||
color: Qt.rgba(1.0, 0.5, 0, 1)
|
GradientStop
|
||||||
}
|
{
|
||||||
GradientStop
|
position: 1.0
|
||||||
{
|
color: Qt.rgba(0.5, 0, 0, 1)
|
||||||
position: 0.875
|
|
||||||
color: Qt.rgba(1.0, 0.0, 0, 1)
|
|
||||||
}
|
|
||||||
GradientStop
|
|
||||||
{
|
|
||||||
position: 1.0
|
|
||||||
color: Qt.rgba(0.5, 0, 0, 1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
// Copyright (c) 2022 Ultimaker B.V.
|
// Copyright (c) 2022 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue