Use the icon from logo folder for application itself

* Use the icon from the logo folder as application icon
* Add script to convert an SVG logo to icons in different sizes
  suitable for various platforms
This commit is contained in:
Martchus 2023-09-08 21:26:35 +02:00
parent 4bb4d5e5a9
commit 0a951c4554
11 changed files with 49 additions and 0 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW X8 -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="84.6666mm" height="84.6666mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 8467 8467"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<style type="text/css">
<![CDATA[
.str0 {stroke:#E6E6E6;stroke-width:203.2}
.fil2 {fill:#A79ECD}
.fil1 {fill:#333333}
.fil0 {fill:#E6E6E6}
]]>
</style>
</defs>
<g id="Camada_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<path class="fil0 str0" d="M537 2240l0 4240c0,148 36,377 87,514 18,48 36,98 56,145l65 136c72,153 189,282 305,401 11,10 14,15 23,25 107,118 248,206 387,282 174,93 430,187 624,187l4545 0c274,0 616,-164 846,-328 127,-91 302,-273 390,-403 16,-24 21,-36 37,-58 86,-121 170,-330 211,-477 9,-29 14,-40 19,-71 14,-84 35,-168 35,-257l0 -4421c0,-114 -33,-251 -58,-344 -145,-554 -595,-999 -1131,-1179 -125,-42 -308,-82 -435,-82l-4364 0c-285,0 -571,111 -794,238 -28,15 -34,25 -62,42 -148,92 -172,124 -287,238 -112,112 -94,91 -189,222l-118 197c-12,24 -24,42 -36,69l-85 230c-39,137 -71,297 -71,454z"/>
<path class="fil1" d="M5731 4740c395,233 660,662 660,1154 0,740 -600,1340 -1340,1340l-2606 0 1869 -1880c45,-39 24,-22 95,-31 33,-5 57,-7 105,-8 212,-8 539,-114 726,-214 175,-93 348,-216 491,-361z"/>
<path class="fil2" d="M4314 5354c45,-39 24,-22 95,-31 33,-5 57,-7 105,-8 212,-8 539,-114 726,-214 239,-128 478,-311 634,-533 59,-83 137,-202 178,-287l130 -336c21,-100 78,-283 78,-386 0,-429 8,-280 -69,-670 -28,-144 -145,-360 -220,-486 -145,-242 -320,-434 -558,-582 -270,-167 -494,-270 -829,-317 -291,-41 -1744,-20 -2142,-20l0 384 953 1 2 198 954 0 -2 186 -1907 0 0 384 953 1 2 197 953 0 1 186 -1908 0 3 385 950 1 7 197 948 0 0 186 -1905 0 -4 384 954 2 3 184 953 0 -5 199 -1905 -8 3 2683 1869 -1880z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -338,6 +338,7 @@ endif ()
install(FILES ../icons/hicolor/32x32/pianobooster.png DESTINATION share/icons/hicolor/32x32/apps)
install(FILES ../icons/hicolor/48x48/pianobooster.png DESTINATION share/icons/hicolor/48x48/apps)
install(FILES ../icons/hicolor/64x64/pianobooster.png DESTINATION share/icons/hicolor/64x64/apps)
install(FILES ../icons/hicolor/scalable/pianobooster.svg DESTINATION share/icons/hicolor/scalable/apps)
# configure and install music books
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../music/BoosterMusicBooks.zip ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY)

Binary file not shown.

View File

@ -0,0 +1 @@
../../icons/MacOS/pianobooster.icns

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

25
tools/genicons.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
set -e
icon=${1:-logo/Icon4.svg}
# make icons for GNU/Linux application entry
mkdir -p "icons/hicolor/scalable"
cp "$icon" "icons/hicolor/scalable/pianobooster.svg" # cannot be a symlink
for size in 32 48 64 256; do
mkdir -p "icons/hicolor/${size}x${size}"
ffmpeg -y -i "$icon" -vf scale="$size:$size" "icons/hicolor/${size}x${size}/pianobooster.png"
done
# make icon for MacOS bundle (requires png2icns from libicns package)
for size in 32 48 256; do
pngs+=("icons/hicolor/${size}x${size}/pianobooster.png")
done
png2icns "icons/MacOS/pianobooster.icns" "${pngs[@]}"
# make icons for application itself
size=256
for format in ico png; do
ffmpeg -y -i "$icon" -vf scale="$size:$size" "src/images/pianobooster.$format"
done
ln -srf "icons/MacOS/pianobooster.icns" "src/images/pianobooster.icns"