Skip to content

Commit

Permalink
Fix Finder sidebar icon to work as a "template" image and change to S…
Browse files Browse the repository at this point in the history
…F Symbols lineweights

Signed-off-by: Elsie Hupp <[email protected]>
  • Loading branch information
elsiehupp committed Jun 27, 2022
1 parent ffc1a3c commit c527d68
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 50 deletions.
35 changes: 7 additions & 28 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})
Expand All @@ -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}"
Expand All @@ -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"))
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions theme/colored/Nextcloud-sidebar-macos-finder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 0 additions & 22 deletions theme/colored/Nextcloud-sidebar.svg

This file was deleted.

0 comments on commit c527d68

Please sign in to comment.