From 3ce4cee2031e246c8effc662e477ba1b85f42251 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Thu, 10 Oct 2024 16:31:31 +0200 Subject: [PATCH] [indicator] Set QQC2 style The indicator can show the KCM, which uses QML now Make sure we have the right style set on all platforms --- indicator/CMakeLists.txt | 2 +- indicator/main.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/indicator/CMakeLists.txt b/indicator/CMakeLists.txt index 32a09595b..c387b6872 100644 --- a/indicator/CMakeLists.txt +++ b/indicator/CMakeLists.txt @@ -43,7 +43,7 @@ ecm_qt_declare_logging_category(kdeconnect-indicator target_include_directories(kdeconnect-indicator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/systray_actions) -target_link_libraries(kdeconnect-indicator Qt::Widgets KF6::CoreAddons KF6::I18n KF6::Notifications KF6::DBusAddons KF6::KCMUtils KF6::Crash kdeconnectinterfaces kdeconnectcore kdeconnectversion) +target_link_libraries(kdeconnect-indicator Qt::Widgets Qt::QuickControls2 KF6::CoreAddons KF6::I18n KF6::Notifications KF6::DBusAddons KF6::KCMUtils KF6::Crash kdeconnectinterfaces kdeconnectcore kdeconnectversion) if (WIN32) target_link_libraries(kdeconnect-indicator windowsapp) diff --git a/indicator/main.cpp b/indicator/main.cpp index d08d23300..72c95a72d 100644 --- a/indicator/main.cpp +++ b/indicator/main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #ifdef Q_OS_WIN @@ -68,6 +69,11 @@ int main(int argc, char **argv) QApplication::setStyle(QStringLiteral("breeze")); #endif + // Default to org.kde.desktop style unless the user forces another style + if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { + QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); + } + KDBusService dbusService(KDBusService::Unique); // Trigger loading the KIconLoader plugin