diff --git a/YACReaderLibrary/empty_container_info.cpp b/YACReaderLibrary/empty_container_info.cpp index 9dbb5231..ab1cce37 100644 --- a/YACReaderLibrary/empty_container_info.cpp +++ b/YACReaderLibrary/empty_container_info.cpp @@ -1,15 +1,14 @@ #include "empty_container_info.h" +#include "theme.h" + EmptyContainerInfo::EmptyContainerInfo(QWidget *parent) - : QWidget(parent), iconLabel(new QLabel()), titleLabel(new QLabel()) + : QWidget(parent), iconLabel(new QLabel()), titleLabel(new QLabel()) { -#ifdef Q_OS_MAC - backgroundColor = "#FFFFFF"; - titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}"); -#else - backgroundColor = "#2A2A2A"; - titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}"); -#endif + auto theme = Theme::currentTheme(); + + backgroundColor = theme.noComicsContentBackgroundColor; + titleLabel->setStyleSheet(theme.noComicsContentTitleLabelStyle); iconLabel->setAlignment(Qt::AlignCenter); titleLabel->setAlignment(Qt::AlignCenter); diff --git a/YACReaderLibrary/no_search_results_widget.cpp b/YACReaderLibrary/no_search_results_widget.cpp index ef7dc611..8034199c 100644 --- a/YACReaderLibrary/no_search_results_widget.cpp +++ b/YACReaderLibrary/no_search_results_widget.cpp @@ -1,5 +1,7 @@ #include "no_search_results_widget.h" +#include "theme.h" + #include #include #include @@ -7,12 +9,6 @@ NoSearchResultsWidget::NoSearchResultsWidget(QWidget *parent) : QWidget(parent) { -#ifdef Q_OS_MAC - backgroundColor = "#FFFFFF"; -#else - backgroundColor = "#2A2A2A"; -#endif - auto layout = new QVBoxLayout; iconLabel = new QLabel(); @@ -22,11 +18,10 @@ NoSearchResultsWidget::NoSearchResultsWidget(QWidget *parent) titleLabel = new QLabel("No results"); titleLabel->setAlignment(Qt::AlignCenter); -#ifdef Q_OS_MAC - titleLabel->setStyleSheet("QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}"); -#else - titleLabel->setStyleSheet("QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}"); -#endif + auto theme = Theme::currentTheme(); + + backgroundColor = theme.noComicsContentBackgroundColor; + titleLabel->setStyleSheet(theme.noComicsContentTitleLabelStyle); layout->addSpacing(100); layout->addWidget(iconLabel); diff --git a/YACReaderLibrary/theme.h b/YACReaderLibrary/theme.h index 0a07d87a..aa1948ce 100644 --- a/YACReaderLibrary/theme.h +++ b/YACReaderLibrary/theme.h @@ -22,6 +22,9 @@ public: t.itemLibraryNoSelectedStyleSheet = "background-color:transparent;"; t.useNativeFolderIcons = true; + + t.noComicsContentBackgroundColor = "#FFFFFF"; + t.noComicsContentTitleLabelStyle = "QLabel {color:#888888; font-size:24px;font-family:Arial;font-weight:bold;}"; } else { t.isMacosNative = false; @@ -33,6 +36,9 @@ public: t.itemLibraryNoSelectedStyleSheet = "background-color:transparent; color:#DDDFDF;"; t.useNativeFolderIcons = false; + + t.noComicsContentBackgroundColor = "#2A2A2A"; + t.noComicsContentTitleLabelStyle = "QLabel {color:#CCCCCC; font-size:24px;font-family:Arial;font-weight:bold;}"; } return t; @@ -52,6 +58,10 @@ public: //tree folders bool useNativeFolderIcons; + + //EmptyContainerInfo & NoSearchResultsWidget + QString noComicsContentBackgroundColor; + QString noComicsContentTitleLabelStyle; }; #endif // THEME_H