diff --git a/openhantek/src/widgets/sispinbox.cpp b/openhantek/src/widgets/sispinbox.cpp index e15ed38..db84960 100644 --- a/openhantek/src/widgets/sispinbox.cpp +++ b/openhantek/src/widgets/sispinbox.cpp @@ -41,6 +41,8 @@ SiSpinBox::SiSpinBox(Unit unit, QWidget *parent) : QDoubleSpinBox(parent) { this->init(); this->setUnit(unit); + + this->setBackground(); } /// \brief Cleans up the main window. @@ -177,3 +179,10 @@ void SiSpinBox::init() { /// \brief Resets the ::steppedTo flag after the value has been changed. void SiSpinBox::resetSteppedTo() { this->steppedTo = false; } + +// fix Dark mode background introduced with MacOS 10.24 (mojave) +void SiSpinBox::setBackground() { + QPalette palette; + QColor background = palette.color(QPalette::Window); + this->setStyleSheet("background-color: " + background.name()); +} diff --git a/openhantek/src/widgets/sispinbox.h b/openhantek/src/widgets/sispinbox.h index 1795a44..cd098ba 100644 --- a/openhantek/src/widgets/sispinbox.h +++ b/openhantek/src/widgets/sispinbox.h @@ -31,6 +31,7 @@ class SiSpinBox : public QDoubleSpinBox { private: void init(); + void setBackground(); Unit unit; ///< The SI unit used for this spin box QString unitPostfix; ///< Shown after the unit