From c527d68645be0f3771de26ad0ec30f6ce5c847d5 Mon Sep 17 00:00:00 2001 From: Elsie Hupp Date: Mon, 27 Jun 2022 19:02:17 -0400 Subject: [PATCH] Fix Finder sidebar icon to work as a "template" image and change to SF Symbols lineweights Signed-off-by: Elsie Hupp --- src/gui/CMakeLists.txt | 35 ++++--------------- .../Nextcloud-sidebar-macos-finder.svg | 7 ++++ theme/colored/Nextcloud-sidebar.svg | 22 ------------ 3 files changed, 14 insertions(+), 50 deletions(-) create mode 100644 theme/colored/Nextcloud-sidebar-macos-finder.svg delete mode 100644 theme/colored/Nextcloud-sidebar.svg diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 0f0d4c9e50d56..56f87791f99bb 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -204,6 +204,8 @@ set(client_SRCS tray/usermodel.cpp tray/notificationhandler.h tray/notificationhandler.cpp + tray/notificationcache.h + tray/notificationcache.cpp creds/credentialsfactory.h tray/talkreply.cpp creds/credentialsfactory.cpp @@ -376,7 +378,7 @@ endif() function(generate_sized_png_from_svg icon_path size) set(options) - set(oneValueArgs OUTPUT_ICON_NAME OUTPUT_ICON_FULL_NAME_WLE OUTPUT_ICON_PATH) + set(oneValueArgs OUTPUT_ICON_NAME OUTPUT_ICON_PATH) set(multiValueArgs) cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -392,17 +394,11 @@ function(generate_sized_png_from_svg icon_path size) set(icon_name_dir ${ARG_OUTPUT_ICON_PATH}) endif () - set(output_icon_full_name_wle "${size}-${icon_name_wle}") - - if (ARG_OUTPUT_ICON_FULL_NAME_WLE) - set(output_icon_full_name_wle ${ARG_OUTPUT_ICON_FULL_NAME_WLE}) - endif () - - if (EXISTS "${icon_name_dir}/${output_icon_full_name_wle}.png") + if (EXISTS "${icon_name_dir}/${size}-${icon_name_wle}.png") return() endif() - set(icon_output_name "${output_icon_full_name_wle}.png") + set(icon_output_name "${size}-${icon_name_wle}.png") message(STATUS "Generate ${icon_output_name}") execute_process(COMMAND "${SVG_CONVERTER}" -w ${size} -h ${size} "${icon_path}" -o "${icon_output_name}" @@ -419,23 +415,6 @@ function(generate_sized_png_from_svg icon_path size) endif() endfunction() -set(STATE_ICONS_COLORS colored black white) - -foreach(state_icons_color ${STATE_ICONS_COLORS}) - set(STATE_ICONS_PATH "${theme_dir}/${state_icons_color}/") - - message("Generating state icons from SVG in path: "${STATE_ICONS_PATH}) - - file(GLOB_RECURSE STATE_ICONS_SVG "${STATE_ICONS_PATH}/state-*.svg") - - foreach(state_icon_svg ${STATE_ICONS_SVG}) - get_filename_component(status_icon_name_wle ${state_icon_svg} NAME_WLE) - foreach(size IN ITEMS 16;32;64;128;256) - generate_sized_png_from_svg(${state_icon_svg} ${size} OUTPUT_ICON_FULL_NAME_WLE "${status_icon_name_wle}-${size}") - endforeach() - endforeach() -endforeach() - if ((APPLICATION_ICON_SET MATCHES "PNG") AND (NOT EXISTS "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon.svg")) @@ -445,7 +424,7 @@ if ((APPLICATION_ICON_SET MATCHES "PNG") endif() if(APPLE) - set(MACOS_SIDEBAR_ICON_SVG "${theme_dir}/colored/${APPLICATION_ICON_NAME}-sidebar.svg") + set(MACOS_SIDEBAR_ICON_SVG "${theme_dir}/colored/${APPLICATION_ICON_NAME}-sidebar-macos-finder.svg") generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 16) generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 32) generate_sized_png_from_svg(${MACOS_SIDEBAR_ICON_SVG} 64) @@ -686,7 +665,7 @@ endif() if (APPLE) find_package(Qt5 COMPONENTS MacExtras) - target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras "-framework UserNotifications") + target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras) endif() if(WITH_CRASHREPORTER) diff --git a/theme/colored/Nextcloud-sidebar-macos-finder.svg b/theme/colored/Nextcloud-sidebar-macos-finder.svg new file mode 100644 index 0000000000000..620f219a4e965 --- /dev/null +++ b/theme/colored/Nextcloud-sidebar-macos-finder.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/theme/colored/Nextcloud-sidebar.svg b/theme/colored/Nextcloud-sidebar.svg deleted file mode 100644 index 2068bc8d25781..0000000000000 --- a/theme/colored/Nextcloud-sidebar.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - -