From 5cd7f0cecf8e4c048df1df584f363a880679addf Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 5 Sep 2020 19:29:41 -0500 Subject: [PATCH] [QDark] Make an Object library --- deps/QDark/CMakeLists.txt | 22 ++++++++++++++++++++++ deps/QDark/include/qdark/theme.hpp | 17 +++++++++++++++++ deps/QDark/theme.cpp | 21 +++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 deps/QDark/CMakeLists.txt create mode 100644 deps/QDark/include/qdark/theme.hpp create mode 100644 deps/QDark/theme.cpp diff --git a/deps/QDark/CMakeLists.txt b/deps/QDark/CMakeLists.txt new file mode 100644 index 00000000..a4d24fe9 --- /dev/null +++ b/deps/QDark/CMakeLists.txt @@ -0,0 +1,22 @@ + +find_package(Qt5Widgets REQUIRED) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +add_library( + QDarkStyle OBJECT + theme.cpp + qdarkstyle/style.qrc +) + +target_include_directories( + QDarkStyle PUBLIC + $ + $ +) + +target_link_libraries( + QDarkStyle + Qt5::Widgets +) + diff --git a/deps/QDark/include/qdark/theme.hpp b/deps/QDark/include/qdark/theme.hpp new file mode 100644 index 00000000..8cdcd090 --- /dev/null +++ b/deps/QDark/include/qdark/theme.hpp @@ -0,0 +1,17 @@ +/* + * Copyright 2020 gary@drinkingtea.net + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include + +namespace qdark { + +void load(QApplication *app); + +} diff --git a/deps/QDark/theme.cpp b/deps/QDark/theme.cpp new file mode 100644 index 00000000..fecb1396 --- /dev/null +++ b/deps/QDark/theme.cpp @@ -0,0 +1,21 @@ +/* + * Copyright 2020 gary@drinkingtea.net + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +namespace qdark { + +void load(QApplication *app) { + // load theme + QFile theme(":qdarkstyle/style.qss"); + theme.open(QFile::ReadOnly | QFile::Text); + QTextStream themeStream(&theme); + app->setStyleSheet(themeStream.readAll()); +} + +}