diff --git a/files/styles/style-dark.css b/files/styles/style-dark.css index f58cd19065d0249a429a03484b8f3870ea515b2b..f389978b6a87442113ac567eaa5937407d94cea6 100644 --- a/files/styles/style-dark.css +++ b/files/styles/style-dark.css @@ -254,11 +254,10 @@ QPushButton:pressed, QToolButton:pressed { QPushButton:pressed#killButton { font-weight: bold; min-height: 30px; - color: #000000; + color: #000; background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #bb8500, stop:1 #903000); background-clip: border; - border-width: 1px; - border-color: #555555; + border: 1px solid #555; border-radius: 5px; } @@ -271,7 +270,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; @@ -284,7 +283,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; @@ -300,7 +299,7 @@ QSlider::handle:horizontal { QSlider::handle:horizontal:disabled { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #535258, stop: 1 #050508); - border: 2px solid #444444; + border: 2px solid #444; width: 18px; margin: -5px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */ border-radius: 3px; @@ -321,7 +320,7 @@ QSizeGrip { QSpinBox, QDoubleSpinBox { min-height: 14px; max-height: 18px; - border: 1px solid #4A4A4A; + border: 1px solid #777; border-radius: 5px; } @@ -360,7 +359,7 @@ QTabBar::tab:hover { QTabBar::tab:selected { border: 2px solid #379AC3; - background: #CCC; + background: #555; } QTabWidget::tab-bar { @@ -392,3 +391,13 @@ QToolTip { border-radius: 3px; color: #DDD; } + +WaypointEditableView { + border: 1px solid #777; + border-radius: 5px; + margin-bottom: 3px; +} + +WaypointEditableView QCheckBox, WaypointEditableView .QWidget { + background: none; +} diff --git a/files/styles/style-light.css b/files/styles/style-light.css index 47828c88f53bccfdbbd56171d300b1d1bb94144d..5e9c41c86c7e14b75f274aa3202d1d11553adb24 100644 --- a/files/styles/style-light.css +++ b/files/styles/style-light.css @@ -254,14 +254,17 @@ QPushButton:pressed, QToolButton:pressed { QPushButton:pressed#killButton { font-weight: bold; min-height: 30px; - color: #000000; + color: #000; background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #bb8500, stop:1 #903000); background-clip: border; - border-width: 1px; - border-color: #555555; + border: 1px solid #555; border-radius: 5px; } +QScrollBar { + border: 1px solid #333; +} + QSeparator { color: #EEE; } @@ -392,3 +395,13 @@ QToolTip { border-radius: 3px; color: #000; } + +WaypointEditableView { + border: 1px solid #333; + border-radius: 5px; + margin-bottom: 3px; +} + +WaypointEditableView QCheckBox, WaypointEditableView .QWidget { + background: none; +} diff --git a/src/ui/WaypointEditableView.cc b/src/ui/WaypointEditableView.cc index b0b0934cad3bdcd56324892fb298a0b48862570d..803829521745ca80390c75563d7a8972b80b13ba 100644 --- a/src/ui/WaypointEditableView.cc +++ b/src/ui/WaypointEditableView.cc @@ -20,7 +20,7 @@ #include "WaypointEditableView.h" #include "ui_WaypointEditableView.h" - +#include "MainWindow.h" #include "mission/QGCMissionNavWaypoint.h" #include "mission/QGCMissionNavLoiterUnlim.h" #include "mission/QGCMissionNavLoiterTurns.h" @@ -488,41 +488,41 @@ void WaypointEditableView::updateValues() { m_ui->autoContinue->setChecked(wp->getAutoContinue()); } - m_ui->idLabel->setText(QString("%1").arg(wp->getId())); - + m_ui->idLabel->setText(QString::number(wp->getId())); - QColor backGroundColor = QGC::colorBackground; - + // Style alternating rows of Missions as lighter/darker. + QString backGroundColor; static int lastId = -1; int currId = wp->getId() % 2; - if (currId != lastId) { - - // qDebug() << "COLOR ID: " << currId; if (currId == 1) { - //backGroundColor = backGroundColor.lighter(150); - backGroundColor = QColor("#252528").lighter(150); + if (MainWindow::instance()->getStyle() == MainWindow::QGC_MAINWINDOW_STYLE_LIGHT) + { + backGroundColor = "#999"; + } + else + { + backGroundColor = "#333"; + } } else { - backGroundColor = QColor("#252528").lighter(250); + if (MainWindow::instance()->getStyle() == MainWindow::QGC_MAINWINDOW_STYLE_LIGHT) + { + backGroundColor = "#CCC"; + } + else + { + backGroundColor = "#555"; + } } - // qDebug() << "COLOR:" << backGroundColor.name(); - - // Update color based on id - QString groupBoxStyle = QString("QGroupBox {padding: 0px; margin: 0px; border: 0px; background-color: %1; }").arg(backGroundColor.name()); - QString labelStyle = QString("QWidget {background-color: %1; color: #DDDDDF; border-color: #EEEEEE; }").arg(backGroundColor.name()); - QString checkBoxStyle = QString("QCheckBox {background-color: %1; color: #454545; border-color: #EEEEEE; }").arg(backGroundColor.name()); - QString widgetSlotStyle = QString("QWidget {background-color: %1; color: #DDDDDF; border-color: #EEEEEE; } QSpinBox {background-color: #252528 } QDoubleSpinBox {background-color: #252528 } QComboBox {background-color: #252528 }").arg(backGroundColor.name()); //FIXME There should be a way to declare background color for widgetSlot without letting the children inherit this color. Here, background color for every widget-type (QSpinBox, etc.) has to be declared separately to overrule the coloring of QWidget. - - m_ui->autoContinue->setStyleSheet(checkBoxStyle); - m_ui->selectedBox->setStyleSheet(checkBoxStyle); - m_ui->idLabel->setStyleSheet(labelStyle); - m_ui->groupBox->setStyleSheet(groupBoxStyle); - m_ui->customActionWidget->setStyleSheet(widgetSlotStyle); + + QString newStyle = QString("WaypointEditableView {background-color: %1}").arg(backGroundColor); + + this->setStyleSheet(newStyle); lastId = currId; } @@ -651,3 +651,11 @@ void WaypointEditableView::changeEvent(QEvent *e) break; } } + +void WaypointEditableView::paintEvent(QPaintEvent *) + { + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + } diff --git a/src/ui/WaypointEditableView.h b/src/ui/WaypointEditableView.h index 4977a4cd55bd115bc5e615426987a09c4279d193..fb1916ec418aaf18c0469d8361ab69c5ed16bbe0 100644 --- a/src/ui/WaypointEditableView.h +++ b/src/ui/WaypointEditableView.h @@ -77,7 +77,7 @@ public slots: void remove(); /** @brief Waypoint matching this widget has been deleted */ void deleted(QObject* waypoint); - void changedAutoContinue(int); + void changedAutoContinue(int); void changedFrame(int state); void updateActionView(int action); void initializeActionView(int action); @@ -98,6 +98,7 @@ protected slots: protected: virtual void changeEvent(QEvent *e); + virtual void paintEvent(QPaintEvent *); Waypoint* wp; QGC_WAYPOINTEDITABLEVIEW_MODE viewMode; // Widgets for every mission element @@ -122,7 +123,7 @@ private: signals: void moveUpWaypoint(Waypoint*); void moveDownWaypoint(Waypoint*); - void removeWaypoint(Waypoint*); + void removeWaypoint(Waypoint*); void changeCurrentWaypoint(quint16); void setYaw(double); diff --git a/src/ui/WaypointEditableView.ui b/src/ui/WaypointEditableView.ui index 9ea57c58eada889338f64b91638bf679cb05c136..07a8784df7ba2b5634ec734fc1c48e65a372bbfa 100644 --- a/src/ui/WaypointEditableView.ui +++ b/src/ui/WaypointEditableView.ui @@ -6,8 +6,8 @@ 0 0 - 2208 - 37 + 585 + 45 @@ -26,329 +26,250 @@ Form - QWidget#colorIcon {} - -QWidget { -background-color: #252528; -color: #DDDDDF; -border-color: #CCCCCF; -} - -QCheckBox { -background-color: #252528; -color: #454545; -} - -QGroupBox { - border: 1px solid #EEEEEE; - border-radius: 5px; - padding: 0px 0px 0px 0px; - margin: 0px; -} - - QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top center; /* position at the top center */ - margin: 0 3px 0px 3px; - padding: 0 3px 0px 0px; - font: bold 8px; - } - -QPushButton { - font-weight: bold; - font-size: 12px; - border: 1px solid #465158; - margin: 1px; - border-radius: 2px; - min-width:16px; - max-width: 16px; - min-height: 16px; - max-height: 16px; - padding: 2px; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #59666f, stop: 1 #414B52); -} - -QPushButton:pressed { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #09A2B2, stop: 1 #414B52); -} - + - - - 0 - + - 0 + 6 + + + 6 - - + + + + + 0 + 0 + + + + + 25 + 0 + + + + Waypoint Sequence Number + + + ID + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 20 + 0 + + + + Qt::TabFocus + + + Mission Start + + + Mission Start + + + + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + + 100 + 16777215 + + + + Coordinate frame + + + Coordinate frame + + + QComboBox::AdjustToContentsOnFirstShow + + + + + + + + 0 + 0 + + + + + 120 + 16777215 + + + + Action at Waypoint + + + Action at Waypoint + + + QComboBox::AdjustToContentsOnFirstShow + + + + + 0 0 - + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Automatically continue after this waypoint + + + Automatically continue after this waypoint + + + + + + + + + + + 0 + 0 + + + + + 24 + 24 + + + + Qt::NoFocus + + + Move Up in List + + + Move Up in List + + - - - 2 - - - 4 - - - - - - 0 - 0 - - - - - 20 - 0 - - - - Qt::TabFocus - - - Mission Start - - - Mission Start - - - - - - - 16 - 16 - - - - - - - - - 0 - 0 - - - - - 25 - 0 - - - - Waypoint Sequence Number - - - ID - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 120 - 16777215 - - - - Action at Waypoint - - - Action at Waypoint - - - QComboBox::AdjustToContentsOnFirstShow - - - - - - - - 0 - 0 - - - - - 100 - 16777215 - - - - Coordinate frame - - - Coordinate frame - - - QComboBox::AdjustToContentsOnFirstShow - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - - 5 - 10 - - - - - - - - - 0 - 0 - - - - Automatically continue after this waypoint - - - Automatically continue after this waypoint - - - - - - - - - - - 0 - 0 - - - - - 24 - 24 - - - - Qt::NoFocus - - - Move Up in List - - - Move Up in List - - - - - - - :/files/images/actions/go-up.svg:/files/images/actions/go-up.svg - - - - - - - - 0 - 0 - - - - - 24 - 24 - - - - Qt::NoFocus - - - Move Down in List - - - Move Down in List - - - - - - - :/files/images/actions/go-down.svg:/files/images/actions/go-down.svg - - - - - - - - 0 - 0 - - - - - 24 - 24 - - - - Qt::NoFocus - - - Delete - - - - - - - :/files/images/actions/list-remove.svg:/files/images/actions/list-remove.svg - - - - + + + :/files/images/actions/go-up.svg:/files/images/actions/go-up.svg + + + + + + + + 0 + 0 + + + + + 24 + 24 + + + + Qt::NoFocus + + + Move Down in List + + + Move Down in List + + + + + + + :/files/images/actions/go-down.svg:/files/images/actions/go-down.svg + + + + + + + + 0 + 0 + + + + + 24 + 24 + + + + Qt::NoFocus + + + Delete + + + + + + + :/files/images/actions/list-remove.svg:/files/images/actions/list-remove.svg +