diff --git a/files/styles/style-dark.css b/files/styles/style-dark.css index e85515182a90363ee8cc409909c82f21b95c2b78..c5269d3dc9e580d02bade8aa4eb6674538edd154 100644 --- a/files/styles/style-dark.css +++ b/files/styles/style-dark.css @@ -303,30 +303,6 @@ QStatusBar { border-bottom: 1px solid #101010; 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); -} - -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 { @@ -334,7 +310,7 @@ QPushButton#killButton { min-height: 30px; color: #000000; 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; border-width: 1px; border-color: #555555; @@ -346,7 +322,7 @@ QPushButton:pressed#killButton { min-height: 30px; color: #000000; 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; border-width: 1px; border-color: #555555; diff --git a/files/styles/style-light.css b/files/styles/style-light.css index 7a3d2ce0c27b0f4af6eed6129d0ed6c782bad329..c8a3fe3b1d39cc2f161af346a7117104389ecc05 100644 --- a/files/styles/style-light.css +++ b/files/styles/style-light.css @@ -113,6 +113,27 @@ QGroupBox::title { 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 { border-radius: 2px; border-width: 1px; @@ -163,23 +184,7 @@ QPushButton { padding-right: 8px; } -QPushButton#forceLandButton { - 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 { +QPushButton#forceLandButton, QPushButton#killButton { font-weight: bold; min-height: 30px; background-clip: border; @@ -187,13 +192,6 @@ QPushButton#killButton { border-radius: 5px; } -QPushButton:pressed#killButton { - font-weight: bold; - min-height: 30px; - border-width: 1px; - border-radius: 5px; -} - QPushButton#controlButton { min-height: 25px; } @@ -260,49 +258,40 @@ QSlider::handle:vertical { border-radius: 3px; } -QSpinBox { - min-height: 14px; - max-height: 18px; +QSpinBox, QDoubleSpinBox { border-radius: 5px; border-width: 1px; - border-style: solid; + border-style: solid; + padding-right: 16px; /* make room for the arrows */ } -QSpinBox::up-button { - subcontrol-origin: border; - subcontrol-position: top right; /* position at the top right corner */ - border-image: url(:/files/images/actions/go-up.svg) 1; - border-width: 1px; +QSpinBox::up-button, QDoubleSpinBox::up-button { + subcontrol-origin: border; + subcontrol-position: top right; /* position at the top right corner */ + width: 16px; + padding-right: 1px; + border: none; } -QSpinBox::down-button { - subcontrol-origin: border; - subcontrol-position: bottom right; /* position at the top right corner */ - border-image: url(:/files/images/actions/go-down.svg) 1; - border-width: 1px; +QSpinBox::down-button, QDoubleSpinBox::down-button { + subcontrol-origin: border; + subcontrol-position: bottom right; /* position at bottom right corner */ + width: 16px; + padding-right: 1px; + border: none; } -QTextEdit { - border-radius: 2px; - border-width: 1px; - border-style: solid; +QSpinBox::up-arrow, QDoubleSpinBox::up-arrow { + width: 16px; } -QToolButton { - font-weight: bold; - min-height: 20px; - max-height: 20px; - margin: 1px; - border-radius: 2px; - border-width: 2px; - border-style: solid; - padding-left: 3px; - padding-right: 3px; +QSpinBox::down-arrow, QDoubleSpinBox::down-arrow { + width: 16px; } -QToolTip { - margin: 3px; - border-radius: 3px; +QStatusBar { + border-width: 1px 0; + border-style: solid; } QTabWidget::pane { /* The tab widget frame */ @@ -327,36 +316,33 @@ QTabBar::tab { border-style: solid; } +QTextEdit { + border-radius: 2px; + border-width: 1px; + border-style: solid; +} + QToolBar { margin: 0; border-width: 1px 0; border-style: solid; } -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; +QToolButton { + font-weight: bold; + min-height: 20px; + max-height: 20px; + margin: 1px; + border-radius: 2px; + border-width: 2px; + border-style: solid; + padding-left: 3px; + padding-right: 3px; } -QStatusBar { - border-width: 1px 0; - border-style: solid; +QToolTip { + margin: 3px; + border-radius: 3px; } /** The following are the style-specific colorings for QGC. **/ @@ -382,7 +368,7 @@ QCheckBox::indicator { } QCheckBox::indicator:checked { - background-color: #000; + background-color: #777; } QComboBox { @@ -408,20 +394,6 @@ QDockWidget::close-button:hover, QDockWidget::float-button:hover { 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 { border-color: #222216; } @@ -495,48 +467,20 @@ QProgressBar QLabel { QPushButton { border-style: solid; - border-color: #4A4A4F; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #C3C2C8, stop: 1 #828288); + border-color: #444; + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CCC, stop: 1 #888); } 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 { - 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 { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bbbbbb, stop: 1 #b0b0b0); -} - -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; + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAA, stop: 1 #666); } QPushButton#controlButton { @@ -555,30 +499,38 @@ QSpinBox { border-color: #4A4A4F; } -QSpinBox::up-button { - border-image: url(:/files/images/actions/go-up.svg) 1; - border-width: 1px; +QSpinBox::up-arrow, QDoubleSpinBox::up-arrow { + image: url(:/files/images/actions/go-up.svg); + width: 16px; } -QSpinBox::down-button { - border-image: url(:/files/images/actions/go-down.svg) 1; - border-width: 1px; +QSpinBox::down-arrow, QDoubleSpinBox::down-arrow { + image: url(:/files/images/actions/go-down.svg); + width: 16px; } QStatusBar { - border-bottom-color: #101010; + border-bottom-color: #111; 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 { - border-color: #62676B; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #090909, stop: 1 #F6F6F6); + border-color: #62676B; + 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 { - border-color: #379AC3; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #090909, stop: 1 #F6F6F6); +QTabBar::tab:pressed { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #AAA, stop: 1 #666); +} + +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 */ @@ -586,7 +538,7 @@ QTabWidget::pane { /* The tab widget frame */ } QTextEdit { - border-color: #111; + border-color: #222; } QToolBar { @@ -609,6 +561,5 @@ QToolButton:pressed { } QToolTip { - background-color: #404040; color: #000; } diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index a2c4fc6762d6ccbf89839e7c4a516920e4020e7b..ae2fccd813f0a21db4db1898cc12c02247b8a777 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -115,6 +115,7 @@ MainWindow::MainWindow(QWidget *parent): loadSettings(); emit initStatusChanged("Loading Style."); + qApp->setStyle("plastique"); if (currentStyle == QGC_MAINWINDOW_STYLE_LIGHT) { loadStyle(currentStyle, lightStyleFileName); @@ -1235,8 +1236,6 @@ void MainWindow::enableAutoReconnect(bool enabled) bool MainWindow::loadStyle(QGC_MAINWINDOW_STYLE style, QString cssFile) { - qApp->setStyle("plastique"); - // Store the new style classification. currentStyle = style; @@ -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 qApp->setOverrideCursor(Qt::WaitCursor); - QString style = QString(styleSheet.readAll()); - style.replace("ICONDIR", QCoreApplication::applicationDirPath() + "files/styles/"); + QString style(styleSheet.readAll()); qApp->setStyleSheet(style); if (currentStyle == QGC_MAINWINDOW_STYLE_LIGHT)