Add gradient to header bar

This commit is contained in:
Jaime van Kessel 2018-11-27 12:58:06 +01:00
parent 1a6822436d
commit fb84b344ec
3 changed files with 53 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtGraphicalEffects 1.0
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -153,8 +154,32 @@ UM.MainWindow
} }
visible: stageMenu.source != "" visible: stageMenu.source != ""
height: Math.round(UM.Theme.getSize("stage_menu").height / 2) height: Math.round(UM.Theme.getSize("stage_menu").height / 2)
LinearGradient
{
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(parent.width, 0)
gradient: Gradient
{
GradientStop
{
position: 0.0
color: UM.Theme.getColor("main_window_header_background") color: UM.Theme.getColor("main_window_header_background")
} }
GradientStop
{
position: 0.5
color: UM.Theme.getColor("main_window_header_background_gradient")
}
GradientStop
{
position: 1.0
color: UM.Theme.getColor("main_window_header_background")
}
}
}
}
Connections Connections
{ {

View File

@ -8,6 +8,7 @@ import QtQuick.Controls.Styles 1.1
import UM 1.4 as UM import UM 1.4 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
import QtGraphicalEffects 1.0
import "../Account" import "../Account"
@ -17,7 +18,31 @@ Rectangle
implicitHeight: UM.Theme.getSize("main_window_header").height implicitHeight: UM.Theme.getSize("main_window_header").height
implicitWidth: UM.Theme.getSize("main_window_header").width implicitWidth: UM.Theme.getSize("main_window_header").width
LinearGradient
{
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(parent.width, 0)
gradient: Gradient
{
GradientStop
{
position: 0.0
color: UM.Theme.getColor("main_window_header_background") color: UM.Theme.getColor("main_window_header_background")
}
GradientStop
{
position: 0.5
color: UM.Theme.getColor("main_window_header_background_gradient")
}
GradientStop
{
position: 1.0
color: UM.Theme.getColor("main_window_header_background")
}
}
}
Image Image
{ {

View File

@ -100,6 +100,7 @@
"secondary_button_text": [30, 102, 215, 255], "secondary_button_text": [30, 102, 215, 255],
"main_window_header_background": [10, 8, 80, 255], "main_window_header_background": [10, 8, 80, 255],
"main_window_header_background_gradient": [25, 23, 91, 255],
"main_window_header_button_text_active": [10, 8, 80, 255], "main_window_header_button_text_active": [10, 8, 80, 255],
"main_window_header_button_text_inactive": [255, 255, 255, 255], "main_window_header_button_text_inactive": [255, 255, 255, 255],
"main_window_header_button_text_hovered": [255, 255, 255, 255], "main_window_header_button_text_hovered": [255, 255, 255, 255],