fix: use Verstak brand icon in desktop builds

This commit is contained in:
2026-07-15 19:17:13 +08:00
parent 6eeebd39ad
commit bf965e8bf3
10 changed files with 109 additions and 1 deletions
+26 -1
View File
@@ -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")
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB