7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-03-30 05:46:55 +00:00

Add document type icons

Update Macos script to use doctype icons for icns builds

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14754
This commit is contained in:
Seth Hillbrand 2024-02-09 15:55:06 -08:00
parent 96130725ad
commit cd548e392a
87 changed files with 13484 additions and 663 deletions
bitmap2component
eeschema
gerbview
kicad
pagelayout_editor
pcb_calculator
pcbnew
resources
bitmaps_png
linux
icons/hicolor
128x128/mimetypes
16x16/mimetypes
24x24/mimetypes
32x32/mimetypes
48x48/mimetypes
64x64/mimetypes
scalable/mimetypes
mime

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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -20,8 +20,14 @@ ICONS="bitmap2component
pcbcalculator
pcbnew"
DOCS="project
schematic
pcb
footprint
symbol
worksheet"
for pgm in $ICONS
for doc in $DOCS
do
output=""
@ -29,8 +35,8 @@ do
do
sz=${size%x*}
echo -e '\E[0;32m'"\nMaking the applications icons with size $size."
echo -e '\E[0;32m'"\nMaking the documents icons with size $size."
# MacOS wants icons with 10% clearance on each side
let "sub_sz = $sz * 8 / 10"
@ -49,9 +55,51 @@ do
# Use specialized icons for smaller sizes to keep pixel alignment
if [ $sz -le 32 ]
then
inkscape sources/light/icon_${pgm}_${sz}.svg -o macos_tmp/${pgm}_small_${sz}px.png -w ${sub_sz} -h ${sub_sz} --export-area-snap
inkscape linux/icons/hicolor/scalable/mimetypes/application-x-kicad-${doc}-${sz}.svg -o macos_tmp/${doc}_small_${sz}px.png -w ${sub_sz} -h ${sub_sz} --export-area-snap
else
inkscape sources/light/icon_${pgm}.svg -o macos_tmp/${pgm}_small_${sz}px.png -w ${sub_sz} -h ${sub_sz} --export-area-snap
inkscape linux/icons/hicolor/scalable/mimetypes/application-x-kicad-${doc}.svg -o macos_tmp/${doc}_small_${sz}px.png -w ${sub_sz} -h ${sub_sz} --export-area-snap
fi
convert macos_tmp/${doc}_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/${doc}_${sz}px.png
output+="macos_tmp/${doc}_${sz}px.png "
done
png2icns macos_tmp/${doc}.icns ${output}
done
for pgm in $ICONS
do
output=""
for size in $SIZES
do
sz=${size%x*}
echo -e '\E[0;32m'"\nMaking the applications icons with size $size."
# MacOS wants icons with 10% clearance on each side
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
if [ $sz -le 32 ]
then
inkscape bitmaps_png/sources/light/icon_${pgm}_${sz}.svg -o macos_tmp/${pgm}_small_${sz}px.png -w ${sub_sz} -h ${sub_sz} --export-area-snap
else
inkscape bitmaps_png/sources/light/icon_${pgm}.svg -o macos_tmp/${pgm}_small_${sz}px.png -w ${sub_sz} -h ${sub_sz} --export-area-snap
fi
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
@ -59,18 +107,38 @@ do
output+="macos_tmp/${pgm}_${sz}px.png "
done
if [ ${pgm} == "pcbcalculator" ]
then
# mismatch in the pcbcalculator icon names
png2icns ../pcb_calculator/pcb_calculator.icns ${output}
elif [ ${pgm} == "bitmap2component" ]
then
#bitmap2component does not have associated documents
png2icns ../${pgm}/${pgm}.icns ${output}
else
png2icns ../${pgm}/${pgm}.icns ${output}
cp ../${pgm}/${pgm}.icns ../${pgm}/${pgm}_doc.icns
fi
case ${pgm} in
pcbcalculator)
# mismatch in the pcbcalculator icon names
png2icns ../pcb_calculator/pcb_calculator.icns ${output}
;;
bitmap2component)
# bitmap2component does not have associated documents
png2icns ../${pgm}/${pgm}.icns ${output}
;;
eeschema)
png2icns ../${pgm}/${pgm}.icns ${output}
cp macos_tmp/schematic.icns ../${pgm}/${pgm}_doc.icns
cp macos_tmp/symbol.icns ../${pgm}/libedit_doc.icns
;;
pcbnew)
png2icns ../${pgm}/${pgm}.icns ${output}
cp macos_tmp/pcb.icns ../${pgm}/${pgm}_doc.icns
cp macos_tmp/footprint.icns ../${pgm}/fpedit_doc.icns
;;
kicad)
png2icns ../${pgm}/${pgm}.icns ${output}
cp macos_tmp/project.icns ../${pgm}/${pgm}_doc.icns
;;
pagelayout_editor)
png2icns ../${pgm}/${pgm}.icns ${output}
cp macos_tmp/worksheet.icns ../${pgm}/${pgm}_doc.icns
;;
*)
png2icns ../${pgm}/${pgm}.icns ${output}
cp ../${pgm}/${pgm}.icns ../${pgm}/${pgm}_doc.icns
;;
esac
done
# rm -rf macos_tmp

Binary file not shown.

After

(image error) Size: 5.6 KiB

Binary file not shown.

Before

(image error) Size: 3.7 KiB

After

(image error) Size: 5.7 KiB

Binary file not shown.

Before

(image error) Size: 2.7 KiB

After

(image error) Size: 5.8 KiB

Binary file not shown.

After

(image error) Size: 4.3 KiB

Binary file not shown.

After

(image error) Size: 5.5 KiB

Binary file not shown.

After

(image error) Size: 847 B

Binary file not shown.

Before

(image error) Size: 447 B

After

(image error) Size: 861 B

Binary file not shown.

Before

(image error) Size: 708 B

After

(image error) Size: 939 B

Binary file not shown.

Before

(image error) Size: 337 B

After

(image error) Size: 795 B

Binary file not shown.

After

(image error) Size: 794 B

Some files were not shown because too many files have changed in this diff Show More