Commit dd078544 authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #1335 from dogmaphobic/toolBarTweaks

Tool bar tweaks
parents af2d735d 5cf65f9f
...@@ -3,12 +3,14 @@ import QtQuick.Controls 1.2 ...@@ -3,12 +3,14 @@ import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.2
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
Button { QGCButton {
id: button id: button
property bool repaintChevron: false property bool repaintChevron: false
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool showHighlight: __showHighlight
style: ButtonStyle { style: ButtonStyle {
background: Item { background: Item {
anchors.margins: 3 anchors.margins: 3
...@@ -21,6 +23,7 @@ Button { ...@@ -21,6 +23,7 @@ Button {
onHoveredChanged: chevron.requestPaint() onHoveredChanged: chevron.requestPaint()
onPressedChanged: chevron.requestPaint() onPressedChanged: chevron.requestPaint()
onCheckedChanged: chevron.requestPaint() onCheckedChanged: chevron.requestPaint()
onShowHighlightChanged: chevron.requestPaint()
onRepaintChevronChanged: { onRepaintChevronChanged: {
if(repaintChevron) { if(repaintChevron) {
chevron.requestPaint() chevron.requestPaint()
...@@ -42,7 +45,7 @@ Button { ...@@ -42,7 +45,7 @@ Button {
context.lineTo(0, height); context.lineTo(0, height);
context.closePath(); context.closePath();
context.strokeStyle = __qgcPal.windowShade context.strokeStyle = __qgcPal.windowShade
context.fillStyle = (button.hovered && !button.pressed) ? __qgcPal.buttonHighlight : (button.checked ? __qgcPal.buttonHighlight : __qgcPal.button); context.fillStyle = showHighlight ? __qgcPal.buttonHighlight : (button.checked ? __qgcPal.buttonHighlight : __qgcPal.button);
context.stroke(); context.stroke();
context.fill(); context.fill();
} }
...@@ -52,7 +55,7 @@ Button { ...@@ -52,7 +55,7 @@ Button {
text: button.text text: button.text
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
color: (button.hovered && !button.pressed) ? __qgcPal.buttonHighlightText : (button.checked ? __qgcPal.primaryButtonText : __qgcPal.buttonText) color: showHighlight ? __qgcPal.buttonHighlightText : (button.checked ? __qgcPal.primaryButtonText : __qgcPal.buttonText)
} }
} }
} }
...@@ -46,11 +46,15 @@ Rectangle { ...@@ -46,11 +46,15 @@ Rectangle {
property var colorBlue: "#1a6eaa" property var colorBlue: "#1a6eaa"
property var colorGreen: "#079527" property var colorGreen: "#079527"
property var colorGreenText: "#00d930"
property var colorRed: "#a81a1b" property var colorRed: "#a81a1b"
property var colorOrange: "#a76f26" property var colorOrange: "#a76f26"
property var colorWhite: "#f0f0f0" property var colorWhite: "#f0f0f0"
property var colorOrangeText: (qgcPal.globalTheme === QGCPalette.Light) ? "#b75711" : "#ea8225"
property var colorRedText: (qgcPal.globalTheme === QGCPalette.Light) ? "#ee1112" : "#ef2526"
property var colorGreenText: (qgcPal.globalTheme === QGCPalette.Light) ? "#046b1b" : "#00d930"
property var colorWhiteText: (qgcPal.globalTheme === QGCPalette.Light) ? "#343333" : "#f0f0f0"
id: toolBarHolder id: toolBarHolder
color: qgcPal.windowShade color: qgcPal.windowShade
...@@ -390,7 +394,7 @@ Rectangle { ...@@ -390,7 +394,7 @@ Rectangle {
font.pointSize: 12 * dpiFactor font.pointSize: 12 * dpiFactor
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.centerIn: parent anchors.centerIn: parent
color: (mainToolBar.systemArmed) ? colorRed : colorGreen color: (mainToolBar.systemArmed) ? colorOrangeText : colorGreenText
} }
} }
...@@ -409,7 +413,7 @@ Rectangle { ...@@ -409,7 +413,7 @@ Rectangle {
font.pointSize: 12 * dpiFactor font.pointSize: 12 * dpiFactor
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.centerIn: parent anchors.centerIn: parent
color: (mainToolBar.currentState === "STANDBY") ? colorGreen : colorRed color: (mainToolBar.currentState === "STANDBY") ? colorGreenText : colorRedText
} }
} }
...@@ -431,7 +435,7 @@ Rectangle { ...@@ -431,7 +435,7 @@ Rectangle {
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: qgcPal.text color: colorWhiteText
} }
} }
...@@ -452,7 +456,7 @@ Rectangle { ...@@ -452,7 +456,7 @@ Rectangle {
font.weight: Font.DemiBold font.weight: Font.DemiBold
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: colorRed color: colorRedText
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment