mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 04:11:16 -05:00
Make the colour highlighting scheme immune to style sheet overrides
This commit is contained in:
parent
a38ec853a4
commit
e4a7591a83
@ -1,7 +1,7 @@
|
|||||||
#include "colorhighlighting.h"
|
#include "colorhighlighting.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDebug>
|
#include <QString>
|
||||||
|
|
||||||
#include "SettingsGroup.hpp"
|
#include "SettingsGroup.hpp"
|
||||||
#include "models/DecodeHighlightingModel.hpp"
|
#include "models/DecodeHighlightingModel.hpp"
|
||||||
@ -113,16 +113,16 @@ void ColorHighlighting::set_items (DecodeHighlightingModel const& highlighting_m
|
|||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto palette = example->parentWidget ()->palette ();
|
auto style_sheet = example->parentWidget ()->styleSheet ();
|
||||||
if (Qt::NoBrush != item.background_.style ())
|
if (Qt::NoBrush != item.background_.style ())
|
||||||
{
|
{
|
||||||
palette.setColor (QPalette::Window, item.background_.color ());
|
style_sheet += QString {"; background-color: #%1"}.arg (item.background_.color ().rgb (), 8, 16, QLatin1Char {'0'});
|
||||||
}
|
}
|
||||||
if (Qt::NoBrush != item.foreground_.style ())
|
if (Qt::NoBrush != item.foreground_.style ())
|
||||||
{
|
{
|
||||||
palette.setColor (QPalette::WindowText, item.foreground_.color ());
|
style_sheet += QString {"; color: #%1"}.arg (item.foreground_.color ().rgb (), 8, 16, QLatin1Char {'0'});
|
||||||
}
|
}
|
||||||
example->setPalette (palette);
|
example->setStyleSheet (style_sheet);
|
||||||
example->setEnabled (item.enabled_);
|
example->setEnabled (item.enabled_);
|
||||||
label->setText (DecodeHighlightingModel::highlight_name (item.type_));
|
label->setText (DecodeHighlightingModel::highlight_name (item.type_));
|
||||||
label->setEnabled (item.enabled_);
|
label->setEnabled (item.enabled_);
|
||||||
|
Loading…
Reference in New Issue
Block a user