Commit 9d974d5a authored by Bryant's avatar Bryant

Synchronized the dark theme to the changes to the light theme from the last...

Synchronized the dark theme to the changes to the light theme from the last commit. Also made more text change color based on selected theme.
parent a0f9044f
......@@ -245,23 +245,22 @@ QPushButton, QToolButton {
max-height: 20px;
border: 1px solid #465158;
margin: 1px;
border-radius: 2px;
border-radius: 4px;
padding-left: 8px;
padding-right: 8px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #777, stop: 1 #333);
}
QPushButton#connectButton {
QPushButton#connectButton, QPushButton#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154);
}
QPushButton#controlButton {
min-height: 25px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A0AE00, stop: 1 #909E00);
}
QPushButton#deleteButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF0037, stop: 1 #AC0025);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D9002F, stop: 1 #AC0025);
}
QPushButton#killButton {
......@@ -278,15 +277,11 @@ QPushButton:checked, QToolButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52);
}
QPushButton:checked#connectButton {
QPushButton:checked#connectButton, QPushButton:checked#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #B37300);
color: #000;
}
QPushButton:checked#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #b76f11, stop: 1 #e1a718);
}
QPushButton:disabled, QToolButton:disabled {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #232228, stop: 1 #020208);
}
......@@ -295,10 +290,26 @@ QPushButton:hover, QToolButton:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #59666f, stop: 1 #414B52);
}
QPushButton:hover#connectButton, QPushButton:hover#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #87FF6D, stop: 1 #1FD16D);
}
QPushButton:hover#deleteButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F20034, stop: 1 #9E0022);
}
QPushButton:pressed, QToolButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bbbbbb, stop: 1 #b0b0b0);
}
QPushButton:pressed#connectButton, QPushButton:pressed#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #62B84E, stop: 1 #148A47);
}
QPushButton:pressed#deleteButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #C9002C, stop: 1 #9C0021);
}
QPushButton:pressed#killButton {
font-weight: bold;
min-height: 30px;
......
......@@ -250,17 +250,16 @@ QPushButton, QToolButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #BBB, stop: 1 #777);
}
QPushButton#connectButton {
QPushButton#connectButton, QPushButton#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154);
}
QPushButton#controlButton {
min-height: 25px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A0AE00, stop: 1 #909E00);
}
QPushButton#deleteButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF0037, stop: 1 #AC0025);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D9002F, stop: 1 #AC0025);
}
QPushButton#killButton {
......@@ -278,15 +277,11 @@ QPushButton:checked, QToolButton:checked {
color: #FFF;
}
QPushButton:checked#connectButton {
QPushButton:checked#connectButton, QPushButton:checked#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FF9000, stop: 1 #B37300);
color: #000;
}
QPushButton:checked#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52);
}
QPushButton:disabled, QToolButton:disabled {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEE, stop: 1 #CCC);
color: #AAA;
......@@ -296,10 +291,26 @@ QPushButton:hover, QToolButton:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #B8D3E6, stop: 1 #899FAD);
}
QPushButton:hover#connectButton, QPushButton:hover#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #87FF6D, stop: 1 #1FD16D);
}
QPushButton:hover#deleteButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F20034, stop: 1 #9E0022);
}
QPushButton:pressed, QToolButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAA, stop: 1 #666);
}
QPushButton:pressed#connectButton, QPushButton:pressed#controlButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #62B84E, stop: 1 #148A47);
}
QPushButton:pressed#deleteButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #C9002C, stop: 1 #9C0021);
}
QPushButton:pressed#killButton {
font-weight: bold;
min-height: 30px;
......@@ -323,7 +334,7 @@ QSlider {
}
QSlider::groove:horizontal {
border: 1px solid #999999;
border: 1px solid #999;
height: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
background-color: #4A4A4A;
margin: 2px 0;
......@@ -337,7 +348,7 @@ QSlider::groove:horizontal:disabled {
}
QSlider::groove:vertical {
border: 1px solid #999999;
border: 1px solid #999;
width: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
background-color: #4A4A4A;
margin: 2px 0;
......
......@@ -275,7 +275,7 @@ void HSIDisplay::renderOverlay()
ringColor = QGC::colorBlack;
positionColor = QColor(20, 20, 200);
setpointColor = QColor(150, 250, 150);
labelColor = QGC::colorBlack;
labelColor = QColor(26, 75, 95);
valueColor = QColor(40, 40, 40);
statusColor = QGC::colorOrange;
waypointLineColor = QGC::colorDarkYellow;
......@@ -283,7 +283,7 @@ void HSIDisplay::renderOverlay()
}
else
{
ringColor = QColor(200, 200, 200);
ringColor = QColor(255, 255, 255);
positionColor = QColor(20, 20, 200);
setpointColor = QColor(150, 250, 150);
labelColor = QGC::colorCyan;
......@@ -464,17 +464,23 @@ void HSIDisplay::drawStatusFlag(float x, float y, QString label, bool status, bo
void HSIDisplay::drawStatusFlag(float x, float y, QString label, bool status, bool known, bool ok, QPainter& painter)
{
paintText(label, QGC::colorCyan, 2.6f, x, y+0.8f, &painter);
QColor statusColor;
QColor labelColor;
if (MainWindow::instance()->getStyle() == MainWindow::QGC_MAINWINDOW_STYLE_LIGHT)
{
statusColor = QColor(40, 40, 40);
labelColor = QColor(26, 75, 95);
}
else
{
statusColor = QColor(250, 250, 250);
labelColor = QGC::colorCyan;
}
// Draw the label.
paintText(label, labelColor, 2.6f, x, y+0.8f, &painter);
// Determine color of status rectangle.
if (!ok) {
painter.setBrush(QGC::colorDarkYellow);
} else {
......@@ -486,11 +492,12 @@ void HSIDisplay::drawStatusFlag(float x, float y, QString label, bool status, bo
}
painter.setPen(Qt::NoPen);
// Draw the status rectangle.
float indicatorWidth = refToScreenX(7.0f);
float indicatorHeight = refToScreenY(4.0f);
painter.drawRect(QRect(refToScreenX(x+7.3f), refToScreenY(y+0.05), indicatorWidth, indicatorHeight));
paintText((status) ? tr("ON") : tr("OFF"), statusColor, 2.6f, x+7.9f, y+0.8f, &painter);
// Cross out instrument if state unknown
if (!known)
{
......@@ -515,7 +522,8 @@ void HSIDisplay::drawStatusFlag(float x, float y, QString label, bool status, bo
void HSIDisplay::drawPositionLock(float x, float y, QString label, int status, bool known, QPainter& painter)
{
paintText(label, QGC::colorCyan, 2.6f, x, y+0.8f, &painter);
// Select color scheme based on light or dark window theme.
QColor labelColor;
QColor negStatusColor(200, 20, 20);
QColor intermediateStatusColor (Qt::yellow);
QColor posStatusColor(20, 200, 20);
......@@ -523,32 +531,34 @@ void HSIDisplay::drawPositionLock(float x, float y, QString label, int status, b
if (MainWindow::instance()->getStyle() == MainWindow::QGC_MAINWINDOW_STYLE_LIGHT)
{
statusColor = QColor(40, 40, 40);
labelColor = QColor(26, 75, 95);
}
else
{
statusColor = QColor(250, 250, 250);
}
if (status == 3) {
painter.setBrush(posStatusColor);
} else if (status == 2) {
painter.setBrush(intermediateStatusColor.dark(150));
} else {
painter.setBrush(negStatusColor);
labelColor = QGC::colorCyan;
}
// Lock text
// Draw the label.
paintText(label, labelColor, 2.6f, x, y+0.8f, &painter);
// based on the status, choose both the coloring and lock text.
QString lockText;
switch (status) {
case 1:
painter.setBrush(intermediateStatusColor.dark(150));
lockText = tr("LOC");
break;
case 2:
painter.setBrush(intermediateStatusColor.dark(150));
lockText = tr("2D");
break;
case 3:
painter.setBrush(posStatusColor);
lockText = tr("3D");
break;
default:
painter.setBrush(negStatusColor);
lockText = tr("NO");
break;
}
......@@ -559,6 +569,7 @@ void HSIDisplay::drawPositionLock(float x, float y, QString label, int status, b
painter.setPen(Qt::NoPen);
painter.drawRect(QRect(refToScreenX(x+7.3f), refToScreenY(y+0.05), refToScreenX(7.0f), refToScreenY(4.0f)));
paintText(lockText, statusColor, 2.6f, x+7.9f, y+0.8f, &painter);
// Cross out instrument if state unknown
if (!known) {
QPen pen(Qt::yellow);
......
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