diff --git a/deps/QDark/CMakeLists.txt b/deps/QDark/CMakeLists.txt new file mode 100644 index 000000000..a4d24fe9b --- /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 000000000..8cdcd090c --- /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 000000000..fecb13961 --- /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()); +} + +}