mirror of
https://github.com/YACReader/yacreader
synced 2026-03-01 18:33:09 -05:00
Initial implementation of theming
This commit is contained in:
@ -1,32 +1,21 @@
|
||||
#include "comics_view_transition.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QMovie>
|
||||
#include <QSettings>
|
||||
#include <QTimer>
|
||||
#include <QSizePolicy>
|
||||
#include <QPainter>
|
||||
|
||||
#include "yacreader_global.h"
|
||||
|
||||
ComicsViewTransition::ComicsViewTransition(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
#ifdef Y_MAC_UI
|
||||
setStyleSheet("QWidget {background:#FFFFFF}");
|
||||
#else
|
||||
setStyleSheet("QWidget {background:#2A2A2A}");
|
||||
#endif
|
||||
initTheme(this);
|
||||
}
|
||||
|
||||
void ComicsViewTransition::applyTheme(const Theme &theme)
|
||||
{
|
||||
setStyleSheet(QString("QWidget {background:%1}").arg(theme.defaultContentBackgroundColor.name()));
|
||||
update();
|
||||
}
|
||||
|
||||
void ComicsViewTransition::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
|
||||
#ifdef Y_MAC_UI
|
||||
painter.fillRect(0, 0, width(), height(), QColor("#FFFFFF"));
|
||||
#else
|
||||
painter.fillRect(0, 0, width(), height(), QColor("#2A2A2A"));
|
||||
#endif
|
||||
painter.fillRect(0, 0, width(), height(), theme.defaultContentBackgroundColor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user