mirror of
https://github.com/YACReader/yacreader
synced 2026-03-01 10:22:58 -05:00
This reduces boilerplate code and remove the ThemeManager dependency at Thamable subclasses level.
28 lines
673 B
C++
28 lines
673 B
C++
#include "scraper_lineedit.h"
|
|
|
|
#include <QLabel>
|
|
|
|
ScraperLineEdit::ScraperLineEdit(const QString &title, QWidget *widget)
|
|
: QLineEdit(widget)
|
|
{
|
|
titleLabel = new QLabel(title, this);
|
|
|
|
setFixedHeight(22);
|
|
|
|
initTheme(this);
|
|
}
|
|
|
|
void ScraperLineEdit::resizeEvent(QResizeEvent *)
|
|
{
|
|
QSize szl = titleLabel->sizeHint();
|
|
titleLabel->move(6, (rect().bottom() + 1 - szl.height()) / 2);
|
|
}
|
|
|
|
void ScraperLineEdit::applyTheme(const Theme &theme)
|
|
{
|
|
auto comicVineTheme = theme.comicVine;
|
|
|
|
titleLabel->setStyleSheet(comicVineTheme.scraperLineEditTitleLabelQSS);
|
|
setStyleSheet(comicVineTheme.scraperLineEditQSS.arg(titleLabel->sizeHint().width() + 6));
|
|
}
|