From 0c0adbdaab92cb8a2f62bbe6bf4c34385d8c8b12 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Thu, 1 Oct 2020 12:58:09 +0100 Subject: [PATCH] Fix widget foreground when forcing the background colour This is required so as to maintain good contrast between foreground and background elements when the widget colour palette is changed, e.g. when using a lights out style sheet. --- widgets/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 8df2966f1..7f5c0a681 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -6675,8 +6675,8 @@ void MainWindow::chk_FST4_freq_range() int diff=ui->sbF_High->value() - ui->sbF_Low->value(); if(diff<100 or diff>maxDiff) { - ui->sbF_Low->setStyleSheet("QSpinBox { background-color: red; }"); - ui->sbF_High->setStyleSheet("QSpinBox { background-color: red; }"); + ui->sbF_Low->setStyleSheet("QSpinBox { color: white; background-color: red; }"); + ui->sbF_High->setStyleSheet("QSpinBox { color: white; background-color: red; }"); } else { ui->sbF_Low->setStyleSheet(""); ui->sbF_High->setStyleSheet("");