diff --git a/icon/CMakeLists.txt b/icon/CMakeLists.txt index d9f06daea..496e739d5 100644 --- a/icon/CMakeLists.txt +++ b/icon/CMakeLists.txt @@ -1,6 +1,5 @@ -ecm_install_icons( -ICONS +set(APP_ICONS 256-apps-kdeconnect.png 128-apps-kdeconnect.png 32-apps-kdeconnect.png @@ -10,7 +9,17 @@ ICONS 16-apps-kdeconnect.png sc-apps-kdeconnect.svgz sc-apps-kdeconnectindicator.svg - sc-apps-kdeconnectindicatordark.svg +) + +if(WIN32) + list(APPEND APP_ICONS sc-apps-kdeconnectindicatorwin.svg) +else() + list(APPEND APP_ICONS sc-apps-kdeconnectindicatordark.svg) +endif() + +ecm_install_icons( +ICONS + ${APP_ICONS} DESTINATION ${ICON_INSTALL_DIR} ) diff --git a/icon/sc-apps-kdeconnectindicatorwin.svg b/icon/sc-apps-kdeconnectindicatorwin.svg new file mode 100644 index 000000000..ea0dc8f50 --- /dev/null +++ b/icon/sc-apps-kdeconnectindicatorwin.svg @@ -0,0 +1,21 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + + diff --git a/indicator/CMakeLists.txt b/indicator/CMakeLists.txt index db3960c19..ec4ac7d57 100644 --- a/indicator/CMakeLists.txt +++ b/indicator/CMakeLists.txt @@ -20,6 +20,8 @@ target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18 if (APPLE) target_link_libraries(kdeconnect-indicator "-framework CoreFoundation") endif() - +if (WIN32) + add_compile_definitions(QSYSTRAY) +endif() install(TARGETS kdeconnect-indicator ${INSTALL_TARGETS_DEFAULT_ARGS}) install(PROGRAMS org.kde.kdeconnect.nonplasma.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) diff --git a/indicator/main.cpp b/indicator/main.cpp index c9bb94ced..40d149b41 100644 --- a/indicator/main.cpp +++ b/indicator/main.cpp @@ -164,7 +164,11 @@ int main(int argc, char** argv) #ifdef QSYSTRAY QSystemTrayIcon systray; +#ifdef Q_OS_WIN + systray.setIcon(QIcon(QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("icons/hicolor/scalable/apps/kdeconnectindicatorwin.svg")))); +#else systray.setIcon(QIcon::fromTheme(QStringLiteral("kdeconnectindicatordark"))); +#endif systray.setVisible(true); systray.setToolTip(QStringLiteral("KDE Connect")); QObject::connect(&model, &DevicesModel::rowsChanged, &model, [&systray, &model]() {