From deb1971bc92ca446523d490742754df729ecd367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Fri, 7 Sep 2018 12:34:59 +0200 Subject: [PATCH] Add a theme class to store all the custom UI values used in the code. It will need a setting for selecting the theme in the factory method. --- YACReaderLibrary/YACReaderLibrary.pro | 6 +++-- YACReaderLibrary/theme.cpp | 6 +++++ YACReaderLibrary/theme.h | 38 +++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 YACReaderLibrary/theme.cpp create mode 100644 YACReaderLibrary/theme.h diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index b39293fc..4e113c5a 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -145,7 +145,8 @@ HEADERS += comic_flow.h \ yacreader_comics_selection_helper.h \ yacreader_comic_info_helper.h \ db/reading_list.h \ - current_comic_view_helper.h + current_comic_view_helper.h \ + theme.h !CONFIG(no_opengl) { HEADERS += ../common/gl/yacreader_flow_gl.h @@ -217,7 +218,8 @@ SOURCES += comic_flow.cpp \ yacreader_comics_selection_helper.cpp \ yacreader_comic_info_helper.cpp\ db/reading_list.cpp \ - current_comic_view_helper.cpp + current_comic_view_helper.cpp \ + theme.cpp !CONFIG(no_opengl) { SOURCES += ../common/gl/yacreader_flow_gl.cpp diff --git a/YACReaderLibrary/theme.cpp b/YACReaderLibrary/theme.cpp new file mode 100644 index 00000000..17d71e22 --- /dev/null +++ b/YACReaderLibrary/theme.cpp @@ -0,0 +1,6 @@ +#include "theme.h" + +Theme::Theme() +{ + +} diff --git a/YACReaderLibrary/theme.h b/YACReaderLibrary/theme.h new file mode 100644 index 00000000..94de5a2a --- /dev/null +++ b/YACReaderLibrary/theme.h @@ -0,0 +1,38 @@ +#ifndef THEME_H +#define THEME_H + +#include + +class Theme +{ +public: + Theme(); + + static Theme currentTheme() { + Theme t; + + if (true) { //native macos theme + t.isMacosNative = true; + + t.disableClassicViewCollapsing = true; + + t.comicsViewTransitionBackground = "#FFFFFF"; + } else { + t.isMacosNative = false; + + t.disableClassicViewCollapsing = false; + + t.comicsViewTransitionBackground = "#2A2A2A"; + } + } + + bool isMacosNative; + + // + bool disableClassicViewCollapsing; + + // + QString comicsViewTransitionBackground; +}; + +#endif // THEME_H