mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Add a theme factory to YACReaderLibrary and theme the comic vine dialog
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user