mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-19 22:40:26 +00:00
Properly color red checkbox labels in validation (part of #12508)
This commit is contained in:
parent
a89ff030cf
commit
b9ca608c2f
@ -223,11 +223,22 @@ bool ColorSorter(ColorCode lhs, ColorCode rhs)
|
||||
void setValid(QWidget * widget, bool valid)
|
||||
{
|
||||
if (valid) {
|
||||
widget->setPalette(QPalette());
|
||||
if (qobject_cast<QCheckBox*>(widget) != nullptr)
|
||||
// Check boxes need to be treated differenty, see
|
||||
// https://forum.qt.io/topic/93253/
|
||||
widget->setStyleSheet("");
|
||||
else
|
||||
widget->setPalette(QPalette());
|
||||
} else {
|
||||
QPalette pal = widget->palette();
|
||||
pal.setColor(QPalette::Active, QPalette::WindowText, QColor(255, 0, 0));
|
||||
widget->setPalette(pal);
|
||||
if (qobject_cast<QCheckBox*>(widget) != nullptr) {
|
||||
// Check boxes need to be treated differenty, see
|
||||
// https://forum.qt.io/topic/93253/
|
||||
widget->setStyleSheet("QCheckBox:unchecked{ color: red; }QCheckBox:checked{ color: red; }");
|
||||
} else {
|
||||
QPalette pal = widget->palette();
|
||||
pal.setColor(QPalette::Active, QPalette::WindowText, QColor(255, 0, 0));
|
||||
widget->setPalette(pal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user