Commit a30a125a authored by dogmaphobic's avatar dogmaphobic

Tweaked text colors in main tool bar.

Tool bar buttons now use QGCButton as base to inherit hover mode fix.
Made QGCButton.showHightLight into a public property so I could use it as a trigger for repainting the chevron button.
parent af2d735d
...@@ -9,10 +9,10 @@ import QGroundControl.MousePosition 1.0 ...@@ -9,10 +9,10 @@ import QGroundControl.MousePosition 1.0
Button { Button {
// primary: true - this is the primary button for this group of buttons // primary: true - this is the primary button for this group of buttons
property bool primary: false property bool primary: false
property bool showHighlight: (pressed | hovered | checked) && !__forceHoverOff
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool __showHighlight: (pressed | hovered | checked) && !__forceHoverOff
// This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can // This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can
// move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn // move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn
...@@ -70,7 +70,7 @@ Button { ...@@ -70,7 +70,7 @@ Button {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: __showHighlight ? color: showHighlight ?
control.__qgcPal.buttonHighlight : control.__qgcPal.buttonHighlight :
(primary ? control.__qgcPal.primaryButton : control.__qgcPal.button) (primary ? control.__qgcPal.primaryButton : control.__qgcPal.button)
} }
...@@ -107,7 +107,7 @@ Button { ...@@ -107,7 +107,7 @@ Button {
renderType: Text.NativeRendering renderType: Text.NativeRendering
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: control.text text: control.text
color: __showHighlight ? color: showHighlight ?
control.__qgcPal.buttonHighlightText : control.__qgcPal.buttonHighlightText :
(primary ? control.__qgcPal.primaryButtonText : control.__qgcPal.buttonText) (primary ? control.__qgcPal.primaryButtonText : control.__qgcPal.buttonText)
} }
......
...@@ -3,9 +3,10 @@ import QtQuick.Controls 1.2 ...@@ -3,9 +3,10 @@ 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 }
...@@ -21,6 +22,7 @@ Button { ...@@ -21,6 +22,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 +44,7 @@ Button { ...@@ -42,7 +44,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 +54,7 @@ Button { ...@@ -52,7 +54,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