mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 15:04:40 -04:00
Inject ComicsViewTransition background color as a string.
This commit is contained in:
committed by
Luis Ángel San Martín
parent
730436c3e9
commit
53fcc52dd6
@ -10,14 +10,10 @@
|
||||
|
||||
#include "yacreader_global_gui.h"
|
||||
|
||||
ComicsViewTransition::ComicsViewTransition(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
ComicsViewTransition::ComicsViewTransition(const QString &backgroundColor, QWidget *parent)
|
||||
: QWidget(parent), backgroundColor(backgroundColor), painter(this)
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
setStyleSheet("QWidget {background:#FFFFFF}");
|
||||
#else
|
||||
setStyleSheet("QWidget {background:#2A2A2A}");
|
||||
#endif
|
||||
setStyleSheet(QString("QWidget {background:%1").arg(backgroundColor));
|
||||
}
|
||||
|
||||
QSize ComicsViewTransition::sizeHint()
|
||||
@ -27,11 +23,5 @@ QSize ComicsViewTransition::sizeHint()
|
||||
|
||||
void ComicsViewTransition::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
painter.fillRect(0, 0, width(), height(), QColor("#FFFFFF"));
|
||||
#else
|
||||
painter.fillRect(0, 0, width(), height(), QColor("#2A2A2A"));
|
||||
#endif
|
||||
painter.fillRect(0, 0, width(), height(), backgroundColor);
|
||||
}
|
||||
|
Reference in New Issue
Block a user