From 82c7a8080dba28aca90c5521bed4b37a3e6604ff Mon Sep 17 00:00:00 2001 From: Piyush Aggarwal Date: Sun, 13 Jun 2021 13:49:12 +0530 Subject: [PATCH] add KColorSchemeManager instance to install auto dark theme on Windows --- app/CMakeLists.txt | 2 +- app/main.cpp | 2 ++ indicator/main.cpp | 2 ++ kcm/kcm.cpp | 2 ++ smsapp/CMakeLists.txt | 1 + smsapp/main.cpp | 2 ++ urlhandler/kdeconnect-handler.cpp | 2 ++ 7 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 7b1376f16..49c91d67c 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -7,7 +7,7 @@ add_executable(kdeconnect-app ${kdeconnect_SRCS} ${kdeconnect_custom_icons_SRCS} ) -target_link_libraries(kdeconnect-app Qt5::Quick Qt5::QuickControls2 Qt5::Widgets KF5::CoreAddons KF5::I18n) +target_link_libraries(kdeconnect-app Qt5::Quick Qt5::QuickControls2 Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::KCMUtils) install(TARGETS kdeconnect-app ${INSTALL_TARGETS_DEFAULT_ARGS}) install(PROGRAMS org.kde.kdeconnect.app.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) diff --git a/app/main.cpp b/app/main.cpp index ce5e468b7..49bd26515 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -15,6 +15,7 @@ #include #include #include +#include int main(int argc, char* argv[]) { @@ -25,6 +26,7 @@ int main(int argc, char* argv[]) KAboutData::setApplicationData(aboutData); #ifdef Q_OS_WIN + KColorSchemeManager manager; QApplication::setStyle(QStringLiteral("breeze")); #endif diff --git a/indicator/main.cpp b/indicator/main.cpp index 300f682e4..c6f40687e 100644 --- a/indicator/main.cpp +++ b/indicator/main.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include "interfaces/devicesmodel.h" #include "interfaces/dbusinterfaces.h" @@ -45,6 +46,7 @@ int main(int argc, char** argv) about.setProgramLogo(QIcon(QStringLiteral(":/icons/kdeconnect/kdeconnect.svg"))); #ifdef Q_OS_WIN + KColorSchemeManager manager; QApplication::setStyle(QStringLiteral("breeze")); IndicatorHelper helper(QUrl::fromLocalFile(qApp->applicationDirPath())); #else diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp index f86955181..9bf227897 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "ui_kcm.h" #include "dbusinterfaces.h" @@ -44,6 +45,7 @@ KdeConnectKcm::KdeConnectKcm(QWidget* parent, const QVariantList& args) setAboutData(about); #ifdef Q_OS_WIN + KColorSchemeManager manager; QApplication::setStyle(QStringLiteral("breeze")); #endif diff --git a/smsapp/CMakeLists.txt b/smsapp/CMakeLists.txt index 7c09af54c..efde6d6e7 100644 --- a/smsapp/CMakeLists.txt +++ b/smsapp/CMakeLists.txt @@ -59,6 +59,7 @@ target_link_libraries(kdeconnect-sms KF5::DBusAddons KF5::I18n KF5::People + KF5::KCMUtils ) install(TARGETS kdeconnect-sms ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/smsapp/main.cpp b/smsapp/main.cpp index 24d4ae0b0..3111d8b86 100644 --- a/smsapp/main.cpp +++ b/smsapp/main.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "smshelper.h" @@ -40,6 +41,7 @@ int main(int argc, char *argv[]) KAboutData::setApplicationData(aboutData); #ifdef Q_OS_WIN + KColorSchemeManager manager; QApplication::setStyle(QStringLiteral("breeze")); #endif diff --git a/urlhandler/kdeconnect-handler.cpp b/urlhandler/kdeconnect-handler.cpp index 5c2ee948a..6a3de2048 100644 --- a/urlhandler/kdeconnect-handler.cpp +++ b/urlhandler/kdeconnect-handler.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -50,6 +51,7 @@ int main(int argc, char** argv) KDBusService dbusService(KDBusService::Unique); #ifdef Q_OS_WIN + KColorSchemeManager manager; QApplication::setStyle(QStringLiteral("breeze")); #endif