Initial implementation of theming

This commit is contained in:
luisangelsm
2026-02-19 17:39:22 +01:00
parent ed28c94f66
commit 044176d6b7
303 changed files with 4634 additions and 2119 deletions

View File

@ -9,23 +9,17 @@ NoLibrariesWidget::NoLibrariesWidget(QWidget *parent)
: QWidget(parent)
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QPalette p(palette());
p.setColor(QPalette::Window, QColor(250, 250, 250));
setAutoFillBackground(true);
setPalette(p);
QPixmap icon(":/images/noLibrariesIcon.png");
QLabel *iconLabel = new QLabel();
iconLabel->setPixmap(icon);
iconLabel = new QLabel();
QPixmap line(":/images/noLibrariesLine.png");
QLabel *lineLabel = new QLabel();
lineLabel->setPixmap(line);
QLabel *text = new QLabel("<font color=\"#495252\">" + tr("You don't have any libraries yet") + "</font>");
text = new QLabel(tr("You don't have any libraries yet"));
text->setStyleSheet("QLabel {font-size:25px;font-weight:bold;}");
QLabel *textDescription = new QLabel("<font color=\"#565959\">" + tr("<p>You can create a library in any folder, YACReaderLibrary will import all comics and folders from this folder. If you have created any library in the past you can open them.</p><p>Don't forget that you can use YACReader as a stand alone application for reading the comics on your computer.</p>") + "</font>");
textDescription = new QLabel(tr("<p>You can create a library in any folder, YACReaderLibrary will import all comics and folders from this folder. If you have created any library in the past you can open them.</p><p>Don't forget that you can use YACReader as a stand alone application for reading the comics on your computer.</p>"));
textDescription->setWordWrap(true);
textDescription->setMaximumWidth(330);
@ -75,4 +69,25 @@ NoLibrariesWidget::NoLibrariesWidget(QWidget *parent)
connect(createButton, &QAbstractButton::clicked, this, &NoLibrariesWidget::createNewLibrary);
connect(addButton, &QAbstractButton::clicked, this, &NoLibrariesWidget::addExistingLibrary);
initTheme(this);
}
void NoLibrariesWidget::applyTheme(const Theme &theme)
{
auto emptyTheme = theme.emptyContainer;
QPalette p(palette());
p.setColor(QPalette::Window, emptyTheme.backgroundColor);
setPalette(p);
QPalette textPalette = text->palette();
textPalette.setColor(QPalette::WindowText, emptyTheme.textColor);
text->setPalette(textPalette);
QPalette descPalette = textDescription->palette();
descPalette.setColor(QPalette::WindowText, emptyTheme.descriptionTextColor);
textDescription->setPalette(descPalette);
iconLabel->setPixmap(emptyTheme.noLibrariesIcon);
}