Add a theme factory to YACReaderLibrary and theme the comic vine dialog

This commit is contained in:
luisangelsm
2026-01-14 19:58:43 +01:00
parent 1cb2f50057
commit 1bd4926b25
30 changed files with 740 additions and 178 deletions

View File

@ -1,5 +1,7 @@
#include "series_question.h"
#include "theme_manager.h"
#include <QRadioButton>
#include <QVBoxLayout>
#include <QLabel>
@ -9,18 +11,10 @@ SeriesQuestion::SeriesQuestion(QWidget *parent)
{
auto l = new QVBoxLayout;
QLabel *questionLabel = new QLabel(tr("You are trying to get information for various comics at once, are they part of the same series?"));
questionLabel->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}");
questionLabel = new QLabel(tr("You are trying to get information for various comics at once, are they part of the same series?"));
yes = new QRadioButton(tr("yes"));
no = new QRadioButton(tr("no"));
QString rbStyle = "QRadioButton {margin-left:27px; margin-top:5px; color:white;font-size:12px;font-family:Arial;}"
"QRadioButton::indicator {width:11px;height:11px;}"
"QRadioButton::indicator::unchecked {image : url(:/images/comic_vine/radioUnchecked.png);}"
"QRadioButton::indicator::checked {image : url(:/images/comic_vine/radioChecked.png);}";
yes->setStyleSheet(rbStyle);
no->setStyleSheet(rbStyle);
yes->setChecked(true);
l->addSpacing(35);
@ -32,6 +26,8 @@ SeriesQuestion::SeriesQuestion(QWidget *parent)
l->setContentsMargins(0, 0, 0, 0);
setLayout(l);
setContentsMargins(0, 0, 0, 0);
initTheme(this);
}
bool SeriesQuestion::getYes()
@ -43,3 +39,12 @@ void SeriesQuestion::setYes(bool y)
{
yes->setChecked(y);
}
void SeriesQuestion::applyTheme()
{
auto comicVineTheme = ThemeManager::instance().getCurrentTheme().comicVine;
questionLabel->setStyleSheet(comicVineTheme.defaultLabelQSS);
yes->setStyleSheet(comicVineTheme.radioButtonQSS);
no->setStyleSheet(comicVineTheme.radioButtonQSS);
}