Commit fdcb5567 authored by Bryant's avatar Bryant

Removed the ICONDIR token from the CSS styles; it wasn't necessary and slowed...

Removed the ICONDIR token from the CSS styles; it wasn't necessary and slowed down applying new styles to QGC.
parent 005ab6ee
...@@ -303,30 +303,6 @@ QStatusBar { ...@@ -303,30 +303,6 @@ QStatusBar {
border-bottom: 1px solid #101010; border-bottom: 1px solid #101010;
border-top: 1px solid #4F4F4F; border-top: 1px solid #4F4F4F;
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4B4B4B, stop:0.3 #404040, stop:0.34 #383838, stop:1 #181818); background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4B4B4B, stop:0.3 #404040, stop:0.34 #383838, stop:1 #181818);
}
QPushButton#forceLandButton {
font-weight: bold;
min-height: 30px;
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffee01, stop:1 #ae8f00) url("ICONDIR/control/emergency-button.png");
background-clip: border;
border-width: 1px;
border-color: #555555;
border-radius: 5px;
}
QPushButton:pressed#forceLandButton {
font-weight: bold;
min-height: 30px;
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #bbaa00, stop:1 #a05b00) url("ICONDIR/control/emergency-button.png");
background-clip: border;
border-width: 1px;
border-color: #555555;
border-radius: 5px;
} }
QPushButton#killButton { QPushButton#killButton {
...@@ -334,7 +310,7 @@ QPushButton#killButton { ...@@ -334,7 +310,7 @@ QPushButton#killButton {
min-height: 30px; min-height: 30px;
color: #000000; color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffb917, stop:1 #b37300) url("ICONDIR/control/emergency-button.png"); stop:0 #ffb917, stop:1 #b37300)
background-clip: border; background-clip: border;
border-width: 1px; border-width: 1px;
border-color: #555555; border-color: #555555;
...@@ -346,7 +322,7 @@ QPushButton:pressed#killButton { ...@@ -346,7 +322,7 @@ QPushButton:pressed#killButton {
min-height: 30px; min-height: 30px;
color: #000000; color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #bb8500, stop:1 #903000) url("ICONDIR/control/emergency-button.png"); stop:0 #bb8500, stop:1 #903000);
background-clip: border; background-clip: border;
border-width: 1px; border-width: 1px;
border-color: #555555; border-color: #555555;
......
...@@ -113,6 +113,27 @@ QGroupBox::title { ...@@ -113,6 +113,27 @@ QGroupBox::title {
font: bold 8px; font: bold 8px;
} }
QLabel {
background: rgba(0,0,0,0);
}
QLabel#toolBarNameLabel {
font: bold 16px;
}
QLabel#toolBarModeLabel {
font: 12px;
}
QLabel#toolBarStateLabel {
font: 12px;
}
QLabel#toolBarMessageLabel {
font: 12px;
font-style: italic;
}
QLineEdit { QLineEdit {
border-radius: 2px; border-radius: 2px;
border-width: 1px; border-width: 1px;
...@@ -163,23 +184,7 @@ QPushButton { ...@@ -163,23 +184,7 @@ QPushButton {
padding-right: 8px; padding-right: 8px;
} }
QPushButton#forceLandButton { QPushButton#forceLandButton, QPushButton#killButton {
font-weight: bold;
min-height: 30px;
background-clip: border;
border-width: 1px;
border-radius: 5px;
}
QPushButton:pressed#forceLandButton {
font-weight: bold;
min-height: 30px;
background-clip: border;
border-width: 1px;
border-radius: 5px;
}
QPushButton#killButton {
font-weight: bold; font-weight: bold;
min-height: 30px; min-height: 30px;
background-clip: border; background-clip: border;
...@@ -187,13 +192,6 @@ QPushButton#killButton { ...@@ -187,13 +192,6 @@ QPushButton#killButton {
border-radius: 5px; border-radius: 5px;
} }
QPushButton:pressed#killButton {
font-weight: bold;
min-height: 30px;
border-width: 1px;
border-radius: 5px;
}
QPushButton#controlButton { QPushButton#controlButton {
min-height: 25px; min-height: 25px;
} }
...@@ -260,49 +258,40 @@ QSlider::handle:vertical { ...@@ -260,49 +258,40 @@ QSlider::handle:vertical {
border-radius: 3px; border-radius: 3px;
} }
QSpinBox { QSpinBox, QDoubleSpinBox {
min-height: 14px;
max-height: 18px;
border-radius: 5px; border-radius: 5px;
border-width: 1px; border-width: 1px;
border-style: solid; border-style: solid;
padding-right: 16px; /* make room for the arrows */
} }
QSpinBox::up-button { QSpinBox::up-button, QDoubleSpinBox::up-button {
subcontrol-origin: border; subcontrol-origin: border;
subcontrol-position: top right; /* position at the top right corner */ subcontrol-position: top right; /* position at the top right corner */
border-image: url(:/files/images/actions/go-up.svg) 1; width: 16px;
border-width: 1px; padding-right: 1px;
border: none;
} }
QSpinBox::down-button { QSpinBox::down-button, QDoubleSpinBox::down-button {
subcontrol-origin: border; subcontrol-origin: border;
subcontrol-position: bottom right; /* position at the top right corner */ subcontrol-position: bottom right; /* position at bottom right corner */
border-image: url(:/files/images/actions/go-down.svg) 1; width: 16px;
border-width: 1px; padding-right: 1px;
border: none;
} }
QTextEdit { QSpinBox::up-arrow, QDoubleSpinBox::up-arrow {
border-radius: 2px; width: 16px;
border-width: 1px;
border-style: solid;
} }
QToolButton { QSpinBox::down-arrow, QDoubleSpinBox::down-arrow {
font-weight: bold; width: 16px;
min-height: 20px;
max-height: 20px;
margin: 1px;
border-radius: 2px;
border-width: 2px;
border-style: solid;
padding-left: 3px;
padding-right: 3px;
} }
QToolTip { QStatusBar {
margin: 3px; border-width: 1px 0;
border-radius: 3px; border-style: solid;
} }
QTabWidget::pane { /* The tab widget frame */ QTabWidget::pane { /* The tab widget frame */
...@@ -327,36 +316,33 @@ QTabBar::tab { ...@@ -327,36 +316,33 @@ QTabBar::tab {
border-style: solid; border-style: solid;
} }
QTextEdit {
border-radius: 2px;
border-width: 1px;
border-style: solid;
}
QToolBar { QToolBar {
margin: 0; margin: 0;
border-width: 1px 0; border-width: 1px 0;
border-style: solid; border-style: solid;
} }
QLabel { QToolButton {
background: rgba(0,0,0,0); font-weight: bold;
} min-height: 20px;
max-height: 20px;
QLabel#toolBarNameLabel { margin: 1px;
font: bold 16px; border-radius: 2px;
} border-width: 2px;
border-style: solid;
QLabel#toolBarModeLabel { padding-left: 3px;
font: 12px; padding-right: 3px;
}
QLabel#toolBarStateLabel {
font: 12px;
}
QLabel#toolBarMessageLabel {
font: 12px;
font-style: italic;
} }
QStatusBar { QToolTip {
border-width: 1px 0; margin: 3px;
border-style: solid; border-radius: 3px;
} }
/** The following are the style-specific colorings for QGC. **/ /** The following are the style-specific colorings for QGC. **/
...@@ -382,7 +368,7 @@ QCheckBox::indicator { ...@@ -382,7 +368,7 @@ QCheckBox::indicator {
} }
QCheckBox::indicator:checked { QCheckBox::indicator:checked {
background-color: #000; background-color: #777;
} }
QComboBox { QComboBox {
...@@ -408,20 +394,6 @@ QDockWidget::close-button:hover, QDockWidget::float-button:hover { ...@@ -408,20 +394,6 @@ QDockWidget::close-button:hover, QDockWidget::float-button:hover {
background-color: #AAA; background-color: #AAA;
} }
QDoubleSpinBox {
border: 1px solid #4A4A4F;
}
QDoubleSpinBox::up-button {
border-image: url(:/files/images/actions/go-up.svg) 1;
border-width: 1px;
}
QDoubleSpinBox::down-button {
border-image: url(:/files/images/actions/go-down.svg) 1;
border-width: 1px;
}
QGroupBox { QGroupBox {
border-color: #222216; border-color: #222216;
} }
...@@ -495,48 +467,20 @@ QProgressBar QLabel { ...@@ -495,48 +467,20 @@ QProgressBar QLabel {
QPushButton { QPushButton {
border-style: solid; border-style: solid;
border-color: #4A4A4F; border-color: #444;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #C3C2C8, stop: 1 #828288); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CCC, stop: 1 #888);
} }
QPushButton:checked { QPushButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #404040, stop: 1 #808080); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #444, stop: 1 #888);
} }
QPushButton:hover { QPushButton:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #333, stop: 1 #b0b0b0); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #BBB, stop: 1 #777);
} }
QPushButton:pressed { QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bbbbbb, stop: 1 #b0b0b0); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAA, stop: 1 #666);
}
QPushButton#forceLandButton {
border-color: #222;
}
QPushButton#forceLandButton {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffee01, stop:1 #ae8f00) url("ICONDIR/control/emergency-button.png");
}
QPushButton:pressed#forceLandButton {
color: #000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #bbaa00, stop:1 #a05b00) url("ICONDIR/control/emergency-button.png");
border-color: #222;
}
QPushButton#killButton {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffb917, stop:1 #b37300) url("ICONDIR/control/emergency-button.png");
border-color: #222;
}
QPushButton:pressed#killButton {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #bb8500, stop:1 #903000) url("ICONDIR/control/emergency-button.png");
border-color: #222;
} }
QPushButton#controlButton { QPushButton#controlButton {
...@@ -555,30 +499,38 @@ QSpinBox { ...@@ -555,30 +499,38 @@ QSpinBox {
border-color: #4A4A4F; border-color: #4A4A4F;
} }
QSpinBox::up-button { QSpinBox::up-arrow, QDoubleSpinBox::up-arrow {
border-image: url(:/files/images/actions/go-up.svg) 1; image: url(:/files/images/actions/go-up.svg);
border-width: 1px; width: 16px;
} }
QSpinBox::down-button { QSpinBox::down-arrow, QDoubleSpinBox::down-arrow {
border-image: url(:/files/images/actions/go-down.svg) 1; image: url(:/files/images/actions/go-down.svg);
border-width: 1px; width: 16px;
} }
QStatusBar { QStatusBar {
border-bottom-color: #101010; border-bottom-color: #111;
border-top-color: #EEE; border-top-color: #EEE;
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #090909, stop:0.3 #404040, stop:0.34 #383838, stop:1 #F6F6F6); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CCC, stop: 1 #888);
} }
QTabBar::tab { QTabBar::tab {
border-color: #62676B; border-color: #62676B;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #090909, stop: 1 #F6F6F6); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CCC, stop: 1 #888);
}
QTabBar::tab:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #BBB, stop: 1 #777);
} }
QTabBar::tab:selected, QTabBar::tab:hover { QTabBar::tab:pressed {
border-color: #379AC3; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAA, stop: 1 #666);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #090909, stop: 1 #F6F6F6); }
QTabBar::tab:selected {
border-color: #379AC3;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAA, stop: 1 #666);
} }
QTabWidget::pane { /* The tab widget frame */ QTabWidget::pane { /* The tab widget frame */
...@@ -586,7 +538,7 @@ QTabWidget::pane { /* The tab widget frame */ ...@@ -586,7 +538,7 @@ QTabWidget::pane { /* The tab widget frame */
} }
QTextEdit { QTextEdit {
border-color: #111; border-color: #222;
} }
QToolBar { QToolBar {
...@@ -609,6 +561,5 @@ QToolButton:pressed { ...@@ -609,6 +561,5 @@ QToolButton:pressed {
} }
QToolTip { QToolTip {
background-color: #404040;
color: #000; color: #000;
} }
...@@ -115,6 +115,7 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -115,6 +115,7 @@ MainWindow::MainWindow(QWidget *parent):
loadSettings(); loadSettings();
emit initStatusChanged("Loading Style."); emit initStatusChanged("Loading Style.");
qApp->setStyle("plastique");
if (currentStyle == QGC_MAINWINDOW_STYLE_LIGHT) if (currentStyle == QGC_MAINWINDOW_STYLE_LIGHT)
{ {
loadStyle(currentStyle, lightStyleFileName); loadStyle(currentStyle, lightStyleFileName);
...@@ -1235,8 +1236,6 @@ void MainWindow::enableAutoReconnect(bool enabled) ...@@ -1235,8 +1236,6 @@ void MainWindow::enableAutoReconnect(bool enabled)
bool MainWindow::loadStyle(QGC_MAINWINDOW_STYLE style, QString cssFile) bool MainWindow::loadStyle(QGC_MAINWINDOW_STYLE style, QString cssFile)
{ {
qApp->setStyle("plastique");
// Store the new style classification. // Store the new style classification.
currentStyle = style; currentStyle = style;
...@@ -1249,8 +1248,7 @@ bool MainWindow::loadStyle(QGC_MAINWINDOW_STYLE style, QString cssFile) ...@@ -1249,8 +1248,7 @@ bool MainWindow::loadStyle(QGC_MAINWINDOW_STYLE style, QString cssFile)
// Signal to the user that the app will pause to apply a new stylesheet // Signal to the user that the app will pause to apply a new stylesheet
qApp->setOverrideCursor(Qt::WaitCursor); qApp->setOverrideCursor(Qt::WaitCursor);
QString style = QString(styleSheet.readAll()); QString style(styleSheet.readAll());
style.replace("ICONDIR", QCoreApplication::applicationDirPath() + "files/styles/");
qApp->setStyleSheet(style); qApp->setStyleSheet(style);
if (currentStyle == QGC_MAINWINDOW_STYLE_LIGHT) if (currentStyle == QGC_MAINWINDOW_STYLE_LIGHT)
......
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