Make Themable pass the current Theme through applyTheme

This reduces boilerplate code and remove the ThemeManager dependency at Thamable subclasses level.
This commit is contained in:
luisangelsm
2026-01-20 15:57:22 +01:00
parent b662e4975b
commit edd5bbc69c
33 changed files with 55 additions and 77 deletions

View File

@ -1019,11 +1019,11 @@ void Viewer::updateBackgroundColor(const QColor &color)
setPalette(palette);
}
void Viewer::applyTheme()
void Viewer::applyTheme(const Theme &theme)
{
const auto viewerTheme = ThemeManager::instance().getCurrentTheme().viewer;
const auto viewerTheme = theme.viewer;
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor(ThemeManager::instance().getCurrentTheme().viewer.defaultBackgroundColor));
updateBackgroundColor(Configuration::getConfiguration().getBackgroundColor(theme.viewer.defaultBackgroundColor));
const QString textColor = viewerTheme.defaultTextColor.name(QColor::HexArgb);
content->setStyleSheet(QStringLiteral("QLabel { color : %1; background: transparent; }").arg(textColor));