diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-02-02 17:48:30 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-02-02 18:18:07 +0300 |
commit | 4bbffa4c5ef7dbf2b4b4ad636ef4d3901532af6a (patch) | |
tree | 869752f4ae02d0b56e4057bbdca10350f2bcc994 | |
parent | 9caf6636d62cf153862fd33fe47d7332922af468 (diff) |
Fix branded mac sidebar icons
-rw-r--r-- | changelog/unreleased/4387 | 5 | ||||
-rw-r--r-- | cmake/modules/OCGenerateTheme.cmake | 7 | ||||
-rw-r--r-- | src/gui/CMakeLists.txt | 14 |
3 files changed, 15 insertions, 11 deletions
diff --git a/changelog/unreleased/4387 b/changelog/unreleased/4387 new file mode 100644 index 000000000..df5192751 --- /dev/null +++ b/changelog/unreleased/4387 @@ -0,0 +1,5 @@ +Bugfix: Fix missing sidebar icons on Mac with branded builds + +We fixed an issue where branded client where lacking the sidebar icons. + +https://github.com/owncloud/enterprise/issues/4387 diff --git a/cmake/modules/OCGenerateTheme.cmake b/cmake/modules/OCGenerateTheme.cmake index 86381ad69..3913f4a09 100644 --- a/cmake/modules/OCGenerateTheme.cmake +++ b/cmake/modules/OCGenerateTheme.cmake @@ -30,7 +30,7 @@ function(__addIcon THEME ICON_NAME) endif() endfunction() -function(generate_theme TARGET) +function(generate_theme TARGET OWNCLOUD_SIDEBAR_ICONS_OUT) if(NOT "${OEM_THEME_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}") set(QRC ${CMAKE_BINARY_DIR}/theme.qrc) file(WRITE "${QRC}" "<RCC>\n<qresource prefix=\"/client/${APPLICATION_SHORTNAME}\">\n") @@ -46,7 +46,12 @@ function(generate_theme TARGET) endforeach() file(APPEND "${QRC}" "</qresource>\n</RCC>\n") target_sources(${TARGET} PRIVATE ${QRC}) + # add executable icon on windows and osx + file(GLOB_RECURSE OWNCLOUD_SIDEBAR_ICONS "${OEM_THEME_DIR}/theme/colored/*-${APPLICATION_ICON_NAME}-sidebar.png") + else() + file(GLOB_RECURSE OWNCLOUD_SIDEBAR_ICONS "${OEM_THEME_DIR}/theme/colored/*-${APPLICATION_ICON_NAME}-icon-sidebar.png") endif() + set(${OWNCLOUD_SIDEBAR_ICONS_OUT} ${OWNCLOUD_SIDEBAR_ICONS} PARENT_SCOPE) endfunction() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 51824e9af..86bb7d36d 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -205,14 +205,8 @@ target_sources(${APPLICATION_EXECUTABLE} PRIVATE ${PROJECT_SOURCE_DIR}/client.qrc ${PROJECT_SOURCE_DIR}/core_theme.qrc) -generate_theme(${APPLICATION_EXECUTABLE}) -set(theme_dir ${OEM_THEME_DIR}/theme) - -# add executable icon on windows and osx -if(APPLE) - file(GLOB_RECURSE OWNCLOUD_SIDEBAR_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-icon-sidebar.png") - MESSAGE(STATUS "OWNCLOUD_SIDEBAR_ICONS: ${APPLICATION_ICON_NAME}: ${OWNCLOUD_SIDEBAR_ICONS}") -endif() +generate_theme(${APPLICATION_EXECUTABLE} OWNCLOUD_SIDEBAR_ICONS) +MESSAGE(STATUS "OWNCLOUD_SIDEBAR_ICONS: ${APPLICATION_ICON_NAME}: ${OWNCLOUD_SIDEBAR_ICONS}") ecm_add_app_icon(appIcons ICONS "${OWNCLOUD_ICONS}" SIDEBAR_ICONS "${OWNCLOUD_SIDEBAR_ICONS}" OUTFILE_BASENAME "${APPLICATION_ICON_NAME}") target_sources(${APPLICATION_EXECUTABLE} PRIVATE ${appIcons}) @@ -228,9 +222,9 @@ if(NOT APPLE) target_sources(${APPLICATION_EXECUTABLE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/manifest-mingw.rc) endif() else() - file(GLOB _icons "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-icon.png") + file(GLOB _icons "${OEM_THEME_DIR}/theme/colored/*-${APPLICATION_ICON_NAME}-icon.png") foreach(_file ${_icons}) - string(REPLACE "${theme_dir}/colored/" "" _res ${_file}) + string(REPLACE "${OEM_THEME_DIR}/theme/colored/" "" _res ${_file}) string(REPLACE "-${APPLICATION_ICON_NAME}-icon.png" "" _res ${_res}) install(FILES ${_file} RENAME ${APPLICATION_ICON_NAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps) endforeach(_file) |