diff --git a/src/Gui/DlgSettingsViewColor.cpp b/src/Gui/DlgSettingsViewColor.cpp index 748559953d..a03c8c1601 100644 --- a/src/Gui/DlgSettingsViewColor.cpp +++ b/src/Gui/DlgSettingsViewColor.cpp @@ -22,6 +22,10 @@ #include "PreCompiled.h" +#ifndef _PreComp_ +# include +#endif + #include "DlgSettingsViewColor.h" #include "ui_DlgSettingsViewColor.h" @@ -41,6 +45,7 @@ DlgSettingsViewColor::DlgSettingsViewColor(QWidget* parent) ui->setupUi(this); ui->HighlightColor->setEnabled(ui->checkBoxPreselection->isChecked()); ui->SelectionColor->setEnabled(ui->checkBoxSelection->isChecked()); + connect(ui->SwitchGradientColors, &QPushButton::pressed, this, &DlgSettingsViewColor::onSwitchGradientColorsPressed); } /** @@ -98,5 +103,12 @@ void DlgSettingsViewColor::changeEvent(QEvent *e) } } +void DlgSettingsViewColor::onSwitchGradientColorsPressed() +{ + QColor tempColor = ui->backgroundColorFrom->color(); + ui->backgroundColorFrom->setColor(ui->backgroundColorTo->color()); + ui->backgroundColorTo->setColor(tempColor); +} + #include "moc_DlgSettingsViewColor.cpp" diff --git a/src/Gui/DlgSettingsViewColor.h b/src/Gui/DlgSettingsViewColor.h index f3b52ec8d3..9f0b8c12d0 100644 --- a/src/Gui/DlgSettingsViewColor.h +++ b/src/Gui/DlgSettingsViewColor.h @@ -50,6 +50,9 @@ public: protected: void changeEvent(QEvent *e); +protected Q_SLOTS: + void onSwitchGradientColorsPressed(); + private: std::unique_ptr ui; }; diff --git a/src/Gui/DlgSettingsViewColor.ui b/src/Gui/DlgSettingsViewColor.ui index a6e28a6e25..75b851b83b 100644 --- a/src/Gui/DlgSettingsViewColor.ui +++ b/src/Gui/DlgSettingsViewColor.ui @@ -6,30 +6,15 @@ 0 0 - 601 - 598 + 405 + 400 Colors - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - + + Selection @@ -106,7 +91,7 @@ - + 225 225 @@ -140,7 +125,7 @@ - + false @@ -148,7 +133,7 @@ - + 28 173 @@ -163,9 +148,9 @@ - + - + Qt::Horizontal @@ -178,10 +163,10 @@ - + - + Background color for the model view @@ -244,7 +229,7 @@ - + false @@ -261,7 +246,7 @@ - + 20 20 @@ -295,7 +280,7 @@ - + Top color @@ -303,7 +288,7 @@ - + 51 51 @@ -318,23 +303,30 @@ + + + + Switches the colors of the gradient + + + Switch + + + - + Qt::Horizontal - - QSizePolicy::Minimum - - 171 + 40 20 - + Bottom color @@ -342,7 +334,7 @@ - + 151 151 @@ -357,7 +349,7 @@ - + Color gradient will get selected color as middle color @@ -373,7 +365,7 @@ - + false @@ -384,7 +376,7 @@ - + 111 111 @@ -399,9 +391,9 @@ - + - + Qt::Horizontal @@ -414,10 +406,10 @@ - + - + Tree view @@ -482,7 +474,7 @@ Background color for objects in tree view that are currently edited - + 255 255 @@ -515,7 +507,7 @@ Background color for active containers in tree view - + 230 230 @@ -532,7 +524,7 @@ - + Qt::Horizontal @@ -545,10 +537,10 @@ - + - + Qt::Vertical @@ -556,7 +548,7 @@ 20 - 40 + 20 @@ -584,11 +576,6 @@ QCheckBox
Gui/PrefWidgets.h
- - Gui::PrefDoubleSpinBox - QDoubleSpinBox -
Gui/PrefWidgets.h
-
checkBoxPreselection