mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(tray): higher DPI icon
This commit is contained in:
parent
e10256e5bd
commit
0f2e50d265
@ -11,16 +11,26 @@ if ! command -v inkscape &> /dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
script_dir=$(realpath $(dirname $0))
|
script_dir=$(realpath $(dirname $0))
|
||||||
output_dir="$script_dir/../../images/app-icons/tray"
|
images_dir="$script_dir/../../images"
|
||||||
|
output_dir="$images_dir/app-icons/tray"
|
||||||
|
|
||||||
|
function generateDpiScaledIcons {
|
||||||
|
file=$1
|
||||||
|
name=$(basename $file .svg)
|
||||||
|
inkscape -w 16 -h 16 "$file" -o "$output_dir/$name.png"
|
||||||
|
inkscape -w 20 -h 20 "$file" -o "$output_dir/$name@1.25x.png"
|
||||||
|
inkscape -w 24 -h 24 "$file" -o "$output_dir/$name@1.5x.png"
|
||||||
|
inkscape -w 32 -h 32 "$file" -o "$output_dir/$name@2x.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
generateDpiScaledIcons "$images_dir/icon-color.svg"
|
||||||
|
|
||||||
for file in *.svg; do
|
for file in *.svg; do
|
||||||
name=$(basename $file .svg)
|
name=$(basename $file .svg)
|
||||||
inkscape -w 16 -h 16 "$file" -o "$output_dir/$name.png"
|
generateDpiScaledIcons "$file"
|
||||||
inkscape -w 20 -h 20 "$file" -o "$output_dir/$name@1.25x.png"
|
|
||||||
inkscape -w 24 -h 24 "$file" -o "$output_dir/$name@1.5x.png"
|
|
||||||
inkscape -w 32 -h 32 "$file" -o "$output_dir/$name@2x.png"
|
|
||||||
magick "$output_dir/$name.png" -channel RGB -negate "$output_dir/$name-inverted.png"
|
magick "$output_dir/$name.png" -channel RGB -negate "$output_dir/$name-inverted.png"
|
||||||
magick "$output_dir/$name@1.25x.png" -channel RGB -negate "$output_dir/$name-inverted@1.25x.png"
|
magick "$output_dir/$name@1.25x.png" -channel RGB -negate "$output_dir/$name-inverted@1.25x.png"
|
||||||
magick "$output_dir/$name@1.5x.png" -channel RGB -negate "$output_dir/$name-inverted@1.5x.png"
|
magick "$output_dir/$name@1.5x.png" -channel RGB -negate "$output_dir/$name-inverted@1.5x.png"
|
||||||
magick "$output_dir/$name@2x.png" -channel RGB -negate "$output_dir/$name-inverted@2x.png"
|
magick "$output_dir/$name@2x.png" -channel RGB -negate "$output_dir/$name-inverted@2x.png"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
BIN
images/app-icons/tray/icon-color.png
Normal file
BIN
images/app-icons/tray/icon-color.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 626 B |
BIN
images/app-icons/tray/icon-color@1.25x.png
Normal file
BIN
images/app-icons/tray/icon-color@1.25x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 797 B |
BIN
images/app-icons/tray/icon-color@1.5x.png
Normal file
BIN
images/app-icons/tray/icon-color@1.5x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 975 B |
BIN
images/app-icons/tray/icon-color@2x.png
Normal file
BIN
images/app-icons/tray/icon-color@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -35,7 +35,7 @@ function getTrayIconPath() {
|
|||||||
const iconSize = getIconSize();
|
const iconSize = getIconSize();
|
||||||
const suffix = isDev ? "-dev" : "";
|
const suffix = isDev ? "-dev" : "";
|
||||||
|
|
||||||
return path.join(path.dirname(fileURLToPath(import.meta.url)), "../..", "images", "app-icons", "png", `${iconSize}x${iconSize}${suffix}.png`);
|
return path.join(path.dirname(fileURLToPath(import.meta.url)), "../..", "images", "app-icons", "tray", `icon-color.png`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIconPath(name: string) {
|
function getIconPath(name: string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user