diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2020-12-21 17:32:53 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2020-12-21 17:47:57 +0300 |
commit | 1f11a3dd21a40b2adc5b32fc9ad7f0b1ea3bbb87 (patch) | |
tree | c70aa8632d3f6cdee287b0bb6c38b4def0b90be0 | |
parent | 7eb617558d05148eba0bb4ac4fcbce1f8f1a841e (diff) |
Add wizard_logo to the theme icons
-rw-r--r-- | cmake/modules/OCGenerateTheme.cmake | 20 | ||||
-rw-r--r-- | src/libsync/theme.cpp | 5 |
2 files changed, 18 insertions, 7 deletions
diff --git a/cmake/modules/OCGenerateTheme.cmake b/cmake/modules/OCGenerateTheme.cmake index 1f3879289..4db90609a 100644 --- a/cmake/modules/OCGenerateTheme.cmake +++ b/cmake/modules/OCGenerateTheme.cmake @@ -3,13 +3,18 @@ function(__addIcon THEME ICON_NAME) if (EXISTS ${OEM_THEME_DIR}/${icon}) file(APPEND "${QRC}" "<file alias=\"${icon}\">${OEM_THEME_DIR}/${icon}</file>\n") else() - set(SIZES "16;22,32;48;64;128;256;512;1024") - foreach(size ${SIZES}) - set(icon "theme/${THEME}/${ICON_NAME}-${size}.png") - if (EXISTS ${OEM_THEME_DIR}/${icon}) - file(APPEND "${QRC}" "<file alias=\"${icon}\">${OEM_THEME_DIR}/${icon}</file>\n") - endif() - endforeach() + set(icon "theme/${THEME}/${ICON_NAME}.png") + if (EXISTS ${OEM_THEME_DIR}/${icon}) + file(APPEND "${QRC}" "<file alias=\"${icon}\">${OEM_THEME_DIR}/${icon}</file>\n") + else() + set(SIZES "16;22,32;48;64;128;256;512;1024") + foreach(size ${SIZES}) + set(icon "theme/${THEME}/${ICON_NAME}-${size}.png") + if (EXISTS ${OEM_THEME_DIR}/${icon}) + file(APPEND "${QRC}" "<file alias=\"${icon}\">${OEM_THEME_DIR}/${icon}</file>\n") + endif() + endforeach() + endif() endif() endfunction() @@ -18,6 +23,7 @@ function(generate_theme TARGET) set(QRC ${CMAKE_BINARY_DIR}/theme.qrc) file(WRITE "${QRC}" "<RCC>\n<qresource prefix=\"/client/${APPLICATION_SHORTNAME}\">\n") __addIcon("colored" "${APPLICATION_ICON_NAME}-icon") + __addIcon("colored" "wizard_logo") set(STATES "ok;error;information;offline;pause;sync") set(THEMES "colored;dark;black;white") diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index ea150f139..715faae14 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -174,6 +174,11 @@ QIcon Theme::themeIcon(const QString &name, bool sysTray, bool sysTrayMenuVisibl return cached = QIcon(svg); } + const QString png = QStringLiteral("%1/%2/%3.png").arg(path, flavor, name); + if (QFile::exists(png)) { + return cached = QIcon(png); + } + const QList<int> sizes {16, 22, 32, 48, 64, 128, 256, 512, 1024}; QString previousIcon; for (int size : sizes) { |