mirror of
https://github.com/YACReader/yacreader
synced 2026-03-01 10:22:58 -05:00
Initial implementation of theming
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user