mirror of
https://github.com/YACReader/yacreader
synced 2026-03-02 02:43:04 -05:00
Add a theme factory to YACReaderLibrary and theme the comic vine dialog
This commit is contained in:
@ -1,18 +1,17 @@
|
||||
#include "scraper_lineedit.h"
|
||||
|
||||
#include "theme_manager.h"
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
ScraperLineEdit::ScraperLineEdit(const QString &title, QWidget *widget)
|
||||
: QLineEdit(widget)
|
||||
{
|
||||
titleLabel = new QLabel(title, this);
|
||||
titleLabel->setStyleSheet("QLabel {color:white;}");
|
||||
|
||||
setStyleSheet(QString("QLineEdit {"
|
||||
"border:none; background-color: #2E2E2E; color : white; padding-left: %1; padding-bottom: 1px; margin-bottom: 0px;"
|
||||
"}")
|
||||
.arg(titleLabel->sizeHint().width() + 6));
|
||||
|
||||
setFixedHeight(22);
|
||||
|
||||
initTheme(this);
|
||||
}
|
||||
|
||||
void ScraperLineEdit::resizeEvent(QResizeEvent *)
|
||||
@ -20,3 +19,11 @@ void ScraperLineEdit::resizeEvent(QResizeEvent *)
|
||||
QSize szl = titleLabel->sizeHint();
|
||||
titleLabel->move(6, (rect().bottom() + 1 - szl.height()) / 2);
|
||||
}
|
||||
|
||||
void ScraperLineEdit::applyTheme()
|
||||
{
|
||||
auto comicVineTheme = ThemeManager::instance().getCurrentTheme().comicVine;
|
||||
|
||||
titleLabel->setStyleSheet(comicVineTheme.scraperLineEditTitleLabelQSS);
|
||||
setStyleSheet(comicVineTheme.scraperLineEditQSS.arg(titleLabel->sizeHint().width() + 6));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user