1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Mac: Dynamically create the iconset with all alternates (#2272)

This commit is contained in:
Marti Martz 2017-03-21 08:11:46 -06:00 committed by David Rosca
parent 345d03105f
commit c6c907aa45
3 changed files with 26 additions and 1 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@ license_template
Makefile*
bin/qupzilla
bin/QupZilla.dmg
mac/images/qupzilla-dmg-icon.iconset
lib*.so*
bin/core
qupzilla.sh

View File

@ -25,7 +25,30 @@ hdiutil create -size 200m "$TMP/$WORK_TEMPLATE" -type SPARSE -fs HFS+ -volname "
cp images/qupzilla-dmg-background.png "$TMP/$VOLUME_TEMPLATE/.background/"
echo "Creating volume icon set…"
iconutil -c icns images/qupzilla-dmg-icon.iconset -o "$TMP/$VOLUME_TEMPLATE/.VolumeIcon.icns"
ICON=qupzilla-dmg-icon
ICONEXT=png
ICONSETDIR=images/$ICON.iconset
mkdir -p "$ICONSETDIR"
# Convert last with qlmanage since sips does not do SVG
qlmanage -t -s 1024 -o "$ICONSETDIR" "images/$ICON.$ICONEXT"
mv "$ICONSETDIR/$ICON.$ICONEXT.png" "$ICONSETDIR/icon_512x512@2x.png"
# Convert remaining with sips since qlmanage does not do 16 pixels
sizes=( 512 256 128 64 32 16 )
for size in ${sizes[@]}
do
sips -Z $size -s format png "$ICONSETDIR/icon_512x512@2x.png" --out "$ICONSETDIR/icon_${size}x${size}.png"
halfsize=$((size / 2))
if [[ size -ne 16 ]]; then
ln "$ICONSETDIR/icon_${size}x${size}.png" "$ICONSETDIR/icon_${halfsize}x${halfsize}@2x.png"
fi
done
# iconutil will only pick what it needs
iconutil -c icns "$ICONSETDIR" -o "$TMP/$VOLUME_TEMPLATE/.VolumeIcon.icns"
echo "Creating application reference folder…"
mkdir "$TMP/$VOLUME_TEMPLATE/QupZilla.app"
@ -58,4 +81,5 @@ rm "$BUNDLE_PATH/QupZilla.dmg"
hdiutil convert "$TMP/$WORK_TEMPLATE" -format UDBZ -o "$BUNDLE_PATH/QupZilla.dmg"
echo "Cleaning up"
rm -Rf "$ICONSETDIR"
rm "$TMP/$WORK_TEMPLATE"

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB