mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Add drop shadows to MacOS icons
Apple UI guidelines ask for small drop shadows on the icons. We add these using ImageMagick when resizing
This commit is contained in:
parent
e7d8b1a975
commit
6cd4d68d57
Binary file not shown.
@ -34,6 +34,18 @@ do
|
|||||||
# MacOS wants icons with 10% clearance on each side
|
# MacOS wants icons with 10% clearance on each side
|
||||||
let "sub_sz = $sz * 8 / 10"
|
let "sub_sz = $sz * 8 / 10"
|
||||||
|
|
||||||
|
sigma=3
|
||||||
|
if [ $sz -eq 16 ]
|
||||||
|
then
|
||||||
|
sigma=2
|
||||||
|
elif [ $sz -ge 512 ]
|
||||||
|
then
|
||||||
|
sigma=5
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Offset the drop shadow by one smaller than the kernel
|
||||||
|
let "off = $sigma - 1"
|
||||||
|
|
||||||
# Use specialized icons for smaller sizes to keep pixel alignment
|
# Use specialized icons for smaller sizes to keep pixel alignment
|
||||||
if [ $sz -le 32 ]
|
if [ $sz -le 32 ]
|
||||||
then
|
then
|
||||||
@ -42,7 +54,7 @@ do
|
|||||||
inkscape sources/light/icon_${pgm}.svg -o macos_tmp/${pgm}_small_${sz}px.png -w ${sub_sz} -h ${sub_sz} --export-area-snap
|
inkscape sources/light/icon_${pgm}.svg -o macos_tmp/${pgm}_small_${sz}px.png -w ${sub_sz} -h ${sub_sz} --export-area-snap
|
||||||
fi
|
fi
|
||||||
|
|
||||||
convert macos_tmp/${pgm}_small_${sz}px.png -size $size xc:transparent +swap -gravity center -composite macos_tmp/${pgm}_${sz}px.png
|
convert macos_tmp/${pgm}_small_${sz}px.png \( +clone -background black -shadow 80x${sigma}+${off}+${off} \) +swap -background transparent -layers merge +repage -size $size xc:transparent +swap -gravity center -composite macos_tmp/${pgm}_${sz}px.png
|
||||||
|
|
||||||
output+="macos_tmp/${pgm}_${sz}px.png "
|
output+="macos_tmp/${pgm}_${sz}px.png "
|
||||||
done
|
done
|
||||||
@ -61,4 +73,4 @@ do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -rf macos_tmp
|
# rm -rf macos_tmp
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
kicad/kicad.icns
BIN
kicad/kicad.icns
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user