From 18c9b4e66d384de1d4dcb87d1ce9a0d732dc7956 Mon Sep 17 00:00:00 2001 From: Bryant Date: Fri, 31 May 2013 12:21:35 -0700 Subject: [PATCH] Further refinements to the dark/light themes. Focused mostly on the status bar at the bottom. --- files/styles/style-dark.css | 15 ++++++++++++++- files/styles/style-light.css | 14 +++++++++++++- src/ui/QGCMAVLinkLogPlayer.cc | 11 +++++++++++ src/ui/QGCMAVLinkLogPlayer.h | 1 + src/ui/uas/UASView.cc | 12 ++++++------ 5 files changed, 45 insertions(+), 8 deletions(-) diff --git a/files/styles/style-dark.css b/files/styles/style-dark.css index 3534bd57d..11ef7aa7c 100644 --- a/files/styles/style-dark.css +++ b/files/styles/style-dark.css @@ -70,6 +70,18 @@ QDockWidget::title { height: 14px; } +QGCMAVLinkLogPlayer { + background: none; +} + +QGCMAVLinkLogPlayer QLabel { + color: #FFF; +} + +QGCMAVLinkLogPlayer QLabel:disabled { + color: #AAA; +} + QGCToolBar QLabel { font-size: 10pt; margin: 3px 2px; @@ -182,6 +194,7 @@ QMenu::item:selected, QMenu::item:checked:selected { QMenu::item:checked { background-color: #B8D3E6; + color: #000; } QMenu::separator { @@ -329,7 +342,7 @@ QSlider::groove:horizontal { QSlider::groove:horizontal:disabled { border: 1px solid #454545; - background-color: #CCC; + background-color: #4A4A4A; height: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ margin: 2px 0; } diff --git a/files/styles/style-light.css b/files/styles/style-light.css index 33ddbc5d0..1081eeac4 100644 --- a/files/styles/style-light.css +++ b/files/styles/style-light.css @@ -70,6 +70,18 @@ QDockWidget::title { height: 14px; } +QGCMAVLinkLogPlayer { + background: none; +} + +QGCMAVLinkLogPlayer QLabel { + color: #FFF; +} + +QGCMAVLinkLogPlayer QLabel:disabled { + color: #666; +} + QGCToolBar QLabel { font-size: 10pt; margin: 3px 2px; @@ -329,7 +341,7 @@ QSlider::groove:horizontal { } QSlider::groove:horizontal:disabled { - border: 1px solid #454545; + border: 1px solid #999; background-color: #CCC; height: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ margin: 2px 0; diff --git a/src/ui/QGCMAVLinkLogPlayer.cc b/src/ui/QGCMAVLinkLogPlayer.cc index 0b5a33cd0..20f7649e7 100644 --- a/src/ui/QGCMAVLinkLogPlayer.cc +++ b/src/ui/QGCMAVLinkLogPlayer.cc @@ -561,3 +561,14 @@ void QGCMAVLinkLogPlayer::changeEvent(QEvent *e) break; } } + +/** + * Implement paintEvent() so that stylesheets work for our custom widget. + */ +void QGCMAVLinkLogPlayer::paintEvent(QPaintEvent *) +{ + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); +} \ No newline at end of file diff --git a/src/ui/QGCMAVLinkLogPlayer.h b/src/ui/QGCMAVLinkLogPlayer.h index df20d7361..647461ecf 100644 --- a/src/ui/QGCMAVLinkLogPlayer.h +++ b/src/ui/QGCMAVLinkLogPlayer.h @@ -99,6 +99,7 @@ protected: private: Ui::QGCMAVLinkLogPlayer *ui; + virtual void paintEvent(QPaintEvent *); }; #endif // QGCMAVLINKLOGPLAYER_H diff --git a/src/ui/uas/UASView.cc b/src/ui/uas/UASView.cc index c4af8643b..8f605e1ee 100644 --- a/src/ui/uas/UASView.cc +++ b/src/ui/uas/UASView.cc @@ -722,9 +722,9 @@ void UASView::changeEvent(QEvent *e) * Implement paintEvent() so that stylesheets work for our custom widget. */ void UASView::paintEvent(QPaintEvent *) - { - QStyleOption opt; - opt.init(this); - QPainter p(this); - style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); - } +{ + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); +} -- 2.22.0