Fix background color in the Viewer so it affects only the desired qwidgets

This commit is contained in:
Luis Ángel San Martín 2025-04-20 18:34:25 +02:00
parent 6c1cb50c62
commit 487df6eec5

View File

@ -57,6 +57,7 @@ Viewer::Viewer(QWidget *parent)
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);
setAlignment(Qt::AlignCenter); setAlignment(Qt::AlignCenter);
setObjectName("YACReaderViewer");
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor()); updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor());
//--------------------------------------- //---------------------------------------
mglass = new MagnifyingGlass( mglass = new MagnifyingGlass(
@ -1030,7 +1031,8 @@ void Viewer::updateOptions()
void Viewer::updateBackgroundColor(const QColor &color) void Viewer::updateBackgroundColor(const QColor &color)
{ {
setStyleSheet(QString("background-color: %1;").arg(color.name())); setStyleSheet(QString("#YACReaderViewer { background-color: %1; }").arg(color.name()));
content->setStyleSheet(QString("background-color: %1;").arg(color.name()));
} }
void Viewer::animateShowTranslator() void Viewer::animateShowTranslator()