mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Extract to theme no comics widgets style.
This commit is contained in:
parent
d2c92c0c2d
commit
a3024a1bee
@ -1,15 +1,14 @@
|
|||||||
#include "empty_container_info.h"
|
#include "empty_container_info.h"
|
||||||
|
|
||||||
|
#include "theme.h"
|
||||||
|
|
||||||
EmptyContainerInfo::EmptyContainerInfo(QWidget *parent)
|
EmptyContainerInfo::EmptyContainerInfo(QWidget *parent)
|
||||||
: QWidget(parent), iconLabel(new QLabel()), titleLabel(new QLabel())
|
: QWidget(parent), iconLabel(new QLabel()), titleLabel(new QLabel())
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MAC
|
auto theme = Theme::currentTheme();
|
||||||
backgroundColor = "#FFFFFF";
|
|
||||||
titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}");
|
backgroundColor = theme.noComicsContentBackgroundColor;
|
||||||
#else
|
titleLabel->setStyleSheet(theme.noComicsContentTitleLabelStyle);
|
||||||
backgroundColor = "#2A2A2A";
|
|
||||||
titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
iconLabel->setAlignment(Qt::AlignCenter);
|
iconLabel->setAlignment(Qt::AlignCenter);
|
||||||
titleLabel->setAlignment(Qt::AlignCenter);
|
titleLabel->setAlignment(Qt::AlignCenter);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "no_search_results_widget.h"
|
#include "no_search_results_widget.h"
|
||||||
|
|
||||||
|
#include "theme.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
@ -7,12 +9,6 @@
|
|||||||
NoSearchResultsWidget::NoSearchResultsWidget(QWidget *parent)
|
NoSearchResultsWidget::NoSearchResultsWidget(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
backgroundColor = "#FFFFFF";
|
|
||||||
#else
|
|
||||||
backgroundColor = "#2A2A2A";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
auto layout = new QVBoxLayout;
|
auto layout = new QVBoxLayout;
|
||||||
|
|
||||||
iconLabel = new QLabel();
|
iconLabel = new QLabel();
|
||||||
@ -22,11 +18,10 @@ NoSearchResultsWidget::NoSearchResultsWidget(QWidget *parent)
|
|||||||
titleLabel = new QLabel("No results");
|
titleLabel = new QLabel("No results");
|
||||||
titleLabel->setAlignment(Qt::AlignCenter);
|
titleLabel->setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
auto theme = Theme::currentTheme();
|
||||||
titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}");
|
|
||||||
#else
|
backgroundColor = theme.noComicsContentBackgroundColor;
|
||||||
titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}");
|
titleLabel->setStyleSheet(theme.noComicsContentTitleLabelStyle);
|
||||||
#endif
|
|
||||||
|
|
||||||
layout->addSpacing(100);
|
layout->addSpacing(100);
|
||||||
layout->addWidget(iconLabel);
|
layout->addWidget(iconLabel);
|
||||||
|
@ -22,6 +22,9 @@ public:
|
|||||||
t.itemLibraryNoSelectedStyleSheet = "background-color:transparent;";
|
t.itemLibraryNoSelectedStyleSheet = "background-color:transparent;";
|
||||||
|
|
||||||
t.useNativeFolderIcons = true;
|
t.useNativeFolderIcons = true;
|
||||||
|
|
||||||
|
t.noComicsContentBackgroundColor = "#FFFFFF";
|
||||||
|
t.noComicsContentTitleLabelStyle = "QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}";
|
||||||
} else {
|
} else {
|
||||||
t.isMacosNative = false;
|
t.isMacosNative = false;
|
||||||
|
|
||||||
@ -33,6 +36,9 @@ public:
|
|||||||
t.itemLibraryNoSelectedStyleSheet = "background-color:transparent; color:#DDDFDF;";
|
t.itemLibraryNoSelectedStyleSheet = "background-color:transparent; color:#DDDFDF;";
|
||||||
|
|
||||||
t.useNativeFolderIcons = false;
|
t.useNativeFolderIcons = false;
|
||||||
|
|
||||||
|
t.noComicsContentBackgroundColor = "#2A2A2A";
|
||||||
|
t.noComicsContentTitleLabelStyle = "QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}";
|
||||||
}
|
}
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
@ -52,6 +58,10 @@ public:
|
|||||||
|
|
||||||
//tree folders
|
//tree folders
|
||||||
bool useNativeFolderIcons;
|
bool useNativeFolderIcons;
|
||||||
|
|
||||||
|
//EmptyContainerInfo & NoSearchResultsWidget
|
||||||
|
QString noComicsContentBackgroundColor;
|
||||||
|
QString noComicsContentTitleLabelStyle;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // THEME_H
|
#endif // THEME_H
|
||||||
|
Loading…
Reference in New Issue
Block a user