mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 06:24:39 -04:00
Use a stylesheet instead of QPalette for consistency across styles
This commit is contained in:
@ -57,9 +57,7 @@ Viewer::Viewer(QWidget *parent)
|
|||||||
setFrameStyle(QFrame::NoFrame);
|
setFrameStyle(QFrame::NoFrame);
|
||||||
setAlignment(Qt::AlignCenter);
|
setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
QPalette palette;
|
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor());
|
||||||
palette.setColor(backgroundRole(), Configuration::getConfiguration().getBackgroundColor());
|
|
||||||
setPalette(palette);
|
|
||||||
//---------------------------------------
|
//---------------------------------------
|
||||||
mglass = new MagnifyingGlass(
|
mglass = new MagnifyingGlass(
|
||||||
Configuration::getConfiguration().getMagnifyingGlassSize(),
|
Configuration::getConfiguration().getMagnifyingGlassSize(),
|
||||||
@ -1032,9 +1030,7 @@ void Viewer::updateOptions()
|
|||||||
|
|
||||||
void Viewer::updateBackgroundColor(const QColor &color)
|
void Viewer::updateBackgroundColor(const QColor &color)
|
||||||
{
|
{
|
||||||
QPalette palette;
|
setStyleSheet(QString("background-color: %1;").arg(color.name()));
|
||||||
palette.setColor(backgroundRole(), color);
|
|
||||||
setPalette(palette);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::animateShowTranslator()
|
void Viewer::animateShowTranslator()
|
||||||
@ -1099,9 +1095,7 @@ void Viewer::updateConfig(QSettings *settings)
|
|||||||
{
|
{
|
||||||
goToFlow->updateConfig(settings);
|
goToFlow->updateConfig(settings);
|
||||||
|
|
||||||
QPalette palette;
|
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor());
|
||||||
palette.setColor(backgroundRole(), Configuration::getConfiguration().getBackgroundColor());
|
|
||||||
setPalette(palette);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// deprecated
|
// deprecated
|
||||||
|
Reference in New Issue
Block a user