From: Pierre Ossman Date: Wed, 11 May 2022 08:17:50 +0000 (+0200) Subject: Add more Unix icon sizes X-Git-Tag: v1.12.90~35^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e28bf7ae8e7e3f9796ae0dd0bc5d5644eb022044;p=tigervnc.git Add more Unix icon sizes Some desktop environment, like KDE, need more rastered sizes and cannot make use of the SVG. --- diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt index 487e9d00..4bed4b6b 100644 --- a/media/CMakeLists.txt +++ b/media/CMakeLists.txt @@ -1,4 +1,4 @@ -set(ICON_SIZES 16 22 24 32 48) +set(ICON_SIZES 16 22 24 32 48 64 128) find_program(CONVERT_EXECUTABLE convert) @@ -9,11 +9,16 @@ if(CONVERT_EXECUTABLE) add_custom_target(icons DEPENDS ${ICON_FILES}) foreach(SIZE ${ICON_SIZES}) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) + set(ICON_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg) + else() + set(ICON_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_48.svg) + endif() add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png COMMAND ${CONVERT_EXECUTABLE} -depth 8 -background transparent - ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg + -size ${SIZE}x${SIZE} ${ICON_SRC_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/icons/tigervnc_${SIZE}.png - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tigervnc_${SIZE}.svg + DEPENDS ${ICON_SRC_FILE} COMMENT "Generating icons/tigervnc_${SIZE}.png") endforeach() endif() diff --git a/media/icons/tigervnc_128.png b/media/icons/tigervnc_128.png new file mode 100644 index 00000000..7eab42d7 Binary files /dev/null and b/media/icons/tigervnc_128.png differ diff --git a/media/icons/tigervnc_64.png b/media/icons/tigervnc_64.png new file mode 100644 index 00000000..cd21c2cf Binary files /dev/null and b/media/icons/tigervnc_64.png differ diff --git a/vncviewer/CMakeLists.txt b/vncviewer/CMakeLists.txt index 7d4455a8..b076347c 100644 --- a/vncviewer/CMakeLists.txt +++ b/vncviewer/CMakeLists.txt @@ -131,7 +131,7 @@ if(UNIX) add_custom_target(appstream ALL DEPENDS org.tigervnc.vncviewer.metainfo.xml) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tigervnc.vncviewer.metainfo.xml DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/metainfo) - foreach(res 16 22 24 32 48) + foreach(res 16 22 24 32 48 64 128) install(FILES ../media/icons/tigervnc_${res}.png DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/${res}x${res}/apps RENAME tigervnc.png) endforeach() install(FILES ../media/icons/tigervnc.svg DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/scalable/apps) diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 028935b7..4afdba46 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -355,7 +355,7 @@ static void init_fltk() Fl_Window::default_icons(lg, sm); #elif ! defined(__APPLE__) - const int icon_sizes[] = {48, 32, 24, 16}; + const int icon_sizes[] = {128, 64, 48, 32, 24, 22, 16}; Fl_PNG_Image *icons[sizeof(icon_sizes)/sizeof(icon_sizes[0])]; int count;