From a02a04d96693fea85e2a834f856973d60ab7f6a5 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 2 Jan 2026 15:48:44 -0500 Subject: [PATCH] Fix icons on Windows KirigamiApp currently calls KIconTheme::initTheme too late for Windows, as a workaround we can go back to calling it ourselves. --- .kde-ci.yml | 1 + CMakeLists.txt | 2 +- src/app/CMakeLists.txt | 1 + src/app/main.cpp | 5 +++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.kde-ci.yml b/.kde-ci.yml index 9f425547b..74a5669f1 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -10,6 +10,7 @@ Dependencies: 'frameworks/ki18n': '@latest-kf6' 'frameworks/kconfig': '@latest-kf6' 'frameworks/syntax-highlighting': '@latest-kf6' + 'frameworks/kiconthemes': '@latest-kf6' 'frameworks/kitemmodels': '@latest-kf6' 'frameworks/kquickcharts': '@latest-kf6' 'frameworks/knotifications': '@latest-kf6' diff --git a/CMakeLists.txt b/CMakeLists.txt index adf609310..eca26f473 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ if (QT_KNOWN_POLICY_QTP0004) qt_policy(SET QTP0004 NEW) endif () -find_package(KF6 ${KF_MIN_VERSION} COMPONENTS Kirigami I18n Notifications Config CoreAddons Sonnet ItemModels ColorScheme) +find_package(KF6 ${KF_MIN_VERSION} COMPONENTS Kirigami I18n Notifications Config CoreAddons Sonnet ItemModels ColorScheme IconThemes) set_package_properties(KF6 PROPERTIES TYPE REQUIRED PURPOSE "Basic application components" diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index e0fa5f494..59c5855e3 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -162,6 +162,7 @@ target_include_directories(neochat-app PRIVATE ${CMAKE_BINARY_DIR}) target_link_libraries(neochat-app PRIVATE neochat + KF6::IconThemes ) ecm_add_app_icon(NEOCHAT_ICON ICONS ${CMAKE_SOURCE_DIR}/128-logo.png) diff --git a/src/app/main.cpp b/src/app/main.cpp index 456a53257..f905da56f 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -33,6 +33,7 @@ #include #endif +#include #include #include #include @@ -102,6 +103,10 @@ int main(int argc, char *argv[]) { QNetworkProxyFactory::setUseSystemConfiguration(true); + // We currently need to do this ourselves, + // KirigamiApp currently called this after constructing the app which breaks icons on Windows. + KIconTheme::initTheme(); + #ifdef HAVE_WEBVIEW QtWebView::initialize(); QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);