Use QtGraphicalEffects.LinearGradient

Instead of using a Rectangle and its gradient prop, since there's no
need for the rotation/scale hack and it gives better quality.
This commit is contained in:
miruka
2019-08-30 19:21:51 -04:00
parent f25a0d7c87
commit 92f6274458
4 changed files with 20 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Window 2.7
import QtGraphicalEffects 1.12
import "Base"
import "SidePane"
@@ -43,16 +44,15 @@ Item {
asynchronous: false
}
Rectangle {
LinearGradient {
id: mainUIGradient
anchors.fill: parent
scale: Math.max(
2.25, Math.ceil(parent.parent.width / parent.parent.height)
)
rotation: theme.ui.gradientRotation
start: theme.ui.gradientStart
end: theme.ui.gradientEnd
gradient: Gradient {
GradientStop { position: 0.0; color: theme.ui.gradientStart }
GradientStop { position: 1.0; color: theme.ui.gradientEnd }
GradientStop { position: 0.0; color: theme.ui.gradientStartColor }
GradientStop { position: 1.0; color: theme.ui.gradientEndColor }
}
}