1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-11-23 13:42:46 +01:00
Nextcloud-Desktop/shell_integration/icons/nopadding/SVG/generate_windows_ico.sh
Jocelyn Turcotte bb5c370575 Windows: Update the overlay icon graphics #3105
The bug seems to be in Windows when it upscales an smaller icon for
HiDPI displays. It works fine if we provide a 256x256 size in the
ico files.

Use the new square icons also used on OS X that removes the share badge
and instead has a share icon only for the OK state. This means that we
can also remove 3 icons and release 3 slots in the registry for
overlay icons (only the first few are actually loaded by explorer).

This also adds a script that uses ImageMagick to convert our SVG icons
to Windows ico files. Since ImageMagick seems to have issue doing
proper antialiasing with pixels on the edge of icons, this also
slightly scale the icons to leave 2px on each edge, out of its
logical 128px width.
2016-01-12 11:46:05 +01:00

9 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
# Dimensions taken from https://www.apriorit.com/dev-blog/357-shell-extentions-basics-samples-common-problems#_Toc408244375
convert -background transparent attention.svg -gravity SouthWest \( -clone 0 -resize 10x10 -extent 16x16 \) \( -clone 0 -resize 16x16 -extent 32x32 \) \( -clone 0 -resize 24x24 -extent 48x48 \) \( -clone 0 -resize 128x128 -extent 256x256 \) -delete 0 ../../../windows/OCOverlays/ico/Warning.ico
convert -background transparent error.svg -gravity SouthWest \( -clone 0 -resize 10x10 -extent 16x16 \) \( -clone 0 -resize 16x16 -extent 32x32 \) \( -clone 0 -resize 24x24 -extent 48x48 \) \( -clone 0 -resize 128x128 -extent 256x256 \) -delete 0 ../../../windows/OCOverlays/ico/Error.ico
convert -background transparent ok.svg -gravity SouthWest \( -clone 0 -resize 10x10 -extent 16x16 \) \( -clone 0 -resize 16x16 -extent 32x32 \) \( -clone 0 -resize 24x24 -extent 48x48 \) \( -clone 0 -resize 128x128 -extent 256x256 \) -delete 0 ../../../windows/OCOverlays/ico/OK.ico
convert -background transparent shared.svg -gravity SouthWest \( -clone 0 -resize 10x10 -extent 16x16 \) \( -clone 0 -resize 16x16 -extent 32x32 \) \( -clone 0 -resize 24x24 -extent 48x48 \) \( -clone 0 -resize 128x128 -extent 256x256 \) -delete 0 ../../../windows/OCOverlays/ico/OK_Shared.ico
convert -background transparent sync.svg -gravity SouthWest \( -clone 0 -resize 10x10 -extent 16x16 \) \( -clone 0 -resize 16x16 -extent 32x32 \) \( -clone 0 -resize 24x24 -extent 48x48 \) \( -clone 0 -resize 128x128 -extent 256x256 \) -delete 0 ../../../windows/OCOverlays/ico/Sync.ico