]> source.dussan.org Git - tigervnc.git/commitdiff
Add more Unix icon sizes
authorPierre Ossman <ossman@cendio.se>
Wed, 11 May 2022 08:17:50 +0000 (10:17 +0200)
committerPierre Ossman <ossman@cendio.se>
Wed, 11 May 2022 11:06:25 +0000 (13:06 +0200)
Some desktop environment, like KDE, need more rastered sizes and cannot
make use of the SVG.

media/CMakeLists.txt
media/icons/tigervnc_128.png [new file with mode: 0644]
media/icons/tigervnc_64.png [new file with mode: 0644]
vncviewer/CMakeLists.txt
vncviewer/vncviewer.cxx

index 487e9d00dd86542b750f2ec43d2d78ff9db6903e..4bed4b6b90893a8f2a73a9ad6c0da8ffe7980c88 100644 (file)
@@ -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 (file)
index 0000000..7eab42d
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 (file)
index 0000000..cd21c2c
Binary files /dev/null and b/media/icons/tigervnc_64.png differ
index 7d4455a85fe81832b3d1c3d6fc8bd9f134c0d79f..b076347c5b52c761cc96bf7f748fcc075d601a0c 100644 (file)
@@ -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)
index 028935b7f550d68ee9c540e784bed6369addb416..4afdba4613cac35260dff1d8b5779f3d8e1e9576 100644 (file)
@@ -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;