diff --git a/README.md b/README.md index e225e41..7f85a72 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,7 @@ Each vault is connected separately. The local vault remains the primary copy of * Node.js 20 or newer with npm; * Python 3; * Git; +* ImageMagick (`magick`) to generate the branded tray and application icons; * Wails v2 build dependencies; * WebKitGTK development packages on Linux. diff --git a/README.ru.md b/README.ru.md index 47ff8e8..f5bf807 100644 --- a/README.ru.md +++ b/README.ru.md @@ -232,6 +232,7 @@ sha256sum -c SHA256SUMS --ignore-missing * Node.js 20 или новее и npm; * Python 3; * Git; +* ImageMagick (`magick`) для генерации фирменных значков трея и приложения; * зависимости для сборки Wails v2; * пакеты разработки WebKitGTK в Linux. diff --git a/internal/shell/tray/icon_linux_test.go b/internal/shell/tray/icon_linux_test.go index aeba076..56e419a 100644 --- a/internal/shell/tray/icon_linux_test.go +++ b/internal/shell/tray/icon_linux_test.go @@ -2,7 +2,13 @@ package tray -import "testing" +import ( + "bytes" + "image" + "image/color" + _ "image/png" + "testing" +) func TestDefaultIconUsesPlatformResource(t *testing.T) { icon := DefaultIcon() @@ -15,4 +21,23 @@ func TestDefaultIconUsesPlatformResource(t *testing.T) { if string(icon[:8]) != "\x89PNG\r\n\x1a\n" { t.Fatal("DefaultIcon() is not PNG data on Linux") } + assertVerstakBrand(t, icon) +} + +func assertVerstakBrand(t *testing.T, icon []byte) { + t.Helper() + image, _, err := image.Decode(bytes.NewReader(icon)) + if err != nil { + t.Fatalf("decode tray icon: %v", err) + } + + want := color.NRGBA{R: 0x1c, G: 0x2f, B: 0x4a, A: 0xff} + for y := image.Bounds().Min.Y; y < image.Bounds().Max.Y; y++ { + for x := image.Bounds().Min.X; x < image.Bounds().Max.X; x++ { + if color.NRGBAModel.Convert(image.At(x, y)) == want { + return + } + } + } + t.Fatal("tray icon does not contain the Verstak navy brand color") } diff --git a/internal/shell/tray/verstak.ico b/internal/shell/tray/verstak.ico index 70a0080..c31e3d3 100644 Binary files a/internal/shell/tray/verstak.ico and b/internal/shell/tray/verstak.ico differ diff --git a/internal/shell/tray/verstak.png b/internal/shell/tray/verstak.png index 5be9e8a..42a45ed 100644 Binary files a/internal/shell/tray/verstak.png and b/internal/shell/tray/verstak.png differ diff --git a/release-notes/v0.1.0-alpha.6.md b/release-notes/v0.1.0-alpha.6.md new file mode 100644 index 0000000..1cdeb02 --- /dev/null +++ b/release-notes/v0.1.0-alpha.6.md @@ -0,0 +1,27 @@ +## Highlights + +- Replaced the generic Wails image in the Linux tray and Windows application + resources with the current Verstak workbench icon. +- The desktop build now generates its PNG and multi-resolution ICO resources + from the committed Verstak SVG before packaging, preventing a generic icon + from returning in a clean build. +- The Windows ICO contains 16, 20, 24, 32, 48, and 256 pixel variants; Linux + uses the matching transparent PNG tray image. + +## Главное + +- Стандартный знак Wails в Linux-трее и ресурсах Windows заменён на актуальный + фирменный значок Верстака. +- Перед упаковкой desktop-сборка создаёт PNG и многомасштабный ICO из SVG, + хранящегося в репозитории. Это не позволяет стандартному значку вернуться в + чистой сборке. +- Windows ICO содержит варианты 16, 20, 24, 32, 48 и 256 пикселей; Linux + использует соответствующий прозрачный PNG для трея. + +## Packages / Пакеты + +This prerelease provides a portable Windows archive, a Debian package, and an +AppImage for Linux. + +В этот prerelease входят переносимый архив для Windows, Debian-пакет и AppImage +для Linux. diff --git a/scripts/build-windows.sh b/scripts/build-windows.sh index c85d79e..7db9ac2 100755 --- a/scripts/build-windows.sh +++ b/scripts/build-windows.sh @@ -35,6 +35,8 @@ fi cd "$ROOT" echo "=== verstak desktop Windows amd64 build ===" +"$ROOT/scripts/generate-brand-icons.sh" + if [[ ! -d "$ROOT/frontend/node_modules" ]]; then if [[ -f "$ROOT/frontend/package-lock.json" ]]; then (cd "$ROOT/frontend" && npm ci --no-audit --no-fund) diff --git a/scripts/build.sh b/scripts/build.sh index 715e410..f97e8fd 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -6,6 +6,8 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd)" echo "=== verstak-desktop build ===" echo "" +"$ROOT/scripts/generate-brand-icons.sh" + # ── Dependency checks ── echo "[deps]" if ! command -v go &>/dev/null; then diff --git a/scripts/generate-brand-icons.sh b/scripts/generate-brand-icons.sh new file mode 100755 index 0000000..cc2e750 --- /dev/null +++ b/scripts/generate-brand-icons.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +MAGICK="${MAGICK_BIN:-magick}" +SOURCE="$ROOT/packaging/linux/verstak.svg" + +if ! command -v "$MAGICK" >/dev/null; then + echo "ImageMagick is required to generate Verstak application icons: $MAGICK not found" >&2 + exit 1 +fi +if [[ ! -f "$SOURCE" ]]; then + echo "Verstak SVG icon source is missing: $SOURCE" >&2 + exit 1 +fi + +render_png() { + local size="$1" + local target="$2" + mkdir -p "$(dirname "$target")" + "$MAGICK" -background none "$SOURCE" -resize "${size}x${size}" "PNG32:$target" +} + +render_ico() { + local target="$1" + shift + local temporary + temporary="$(mktemp -d)" + local images=() + for size in "$@"; do + local image="$temporary/${size}.png" + render_png "$size" "$image" + images+=("$image") + done + mkdir -p "$(dirname "$target")" + "$MAGICK" "${images[@]}" "$target" + rm -rf "$temporary" +} + +render_png 256 "$ROOT/internal/shell/tray/verstak.png" +render_ico "$ROOT/internal/shell/tray/verstak.ico" 16 20 24 32 48 256 + +# Wails consumes this PNG while it prepares the Windows executable resources. +# Both files are generated build inputs and therefore deliberately ignored by Git. +render_png 1024 "$ROOT/build/appicon.png" +render_ico "$ROOT/build/windows/icon.ico" 16 32 48 64 128 256 + +echo "generated Verstak tray and application icons from $SOURCE" diff --git a/scripts/test-package-formats.sh b/scripts/test-package-formats.sh index 45b72f3..dc8a725 100755 --- a/scripts/test-package-formats.sh +++ b/scripts/test-package-formats.sh @@ -53,6 +53,8 @@ grep -Fq 'LinkId=2124701' "$ROOT/README.md" grep -Fq 'WebView2 Runtime' "$ROOT/README.md" grep -Fq 'package-deb.sh' "$ROOT/scripts/release.sh" grep -Fq 'package-appimage.sh' "$ROOT/scripts/release.sh" +grep -Fq 'generate-brand-icons.sh' "$ROOT/scripts/build.sh" +grep -Fq 'generate-brand-icons.sh' "$ROOT/scripts/build-windows.sh" grep -Fq 'package-windows-portable.sh' "$ROOT/scripts/release.sh" git -C "$ROOT" check-ignore -q verstak-desktop-res.syso grep -Fq 'chmod -R a+rX' "$ROOT/scripts/build-linux-bundle.sh"