Commit Graph
3 Commits
Author SHA1 Message Date
yetone fb3942ee67 windows: the app's icon fills its square in the taskbar, the tray and Start (dzxx0496)
On Windows 10 magpie's icon looked a size smaller than its neighbours
in the taskbar, the tray overflow and Start's "Recently added"
(dzxx0496 on Discord, #general). Every Windows icon was the Mac's tile:
build/windows/icon-*.png (75cb19264, the exe's icon group #3, which
the window, the taskbar and the Start shortcut's IconLocation exe,0
all use) and internal/gui/icon.png (the tray) were build/icon/gen.go's
app(), on macOS's grid, the tile 80% of the canvas with 10% clear on
each side. Windows draws an app to the edges of its square.

- gen.go: app() and the new win() share tile(). win() is the same
  white tile, shading and bird (.8 of the tile), a 32nd of the side
  clear from 32px up (1px at 32 and 48, 8px at 256) so the rounded
  corners' soft edge stays inside, and to the edge under 32px, where
  that pixel would only blur it; corner radius .2 of the side (.225 on
  the Mac). No new colour.
- build/windows: icon-16 to icon-256 drawn by win(), plus 20, 24 and
  40 px, which Windows asks for at 125% to 250%; winres.json lists
  them.
- The tray takes internal/gui/icon-windows.ico (16, 20, 24, 32, 40,
  48, 64); Wails picks the SM_CXSMICON entry, where the 64px PNG was
  scaled down by the system. icon.png, only the tray's, is gone.
- Makefile's icons target draws all of these.

Not changed: macOS (app() is byte for byte the same at 64, 256 and
1024: cmp against the committed icon-256.png and icon-1024.png; the
.icns, Assets.car and tray.png untouched). Linux: its tray is the
glyph with no tile, and its desktop icon (icon-256.png) keeps the
margin GNOME's and the hicolor theme's app icons have too.

What was run:
- mote: go test ./internal/gui: TestWindowsIconsFillTheirSquare (new),
  TestTrayIconPerOS and TestTrayIconSize ok. Red, each filed and none
  about icons: TestSettingsSaveKeepsWhatItDoesNotSend (#4514, red 3 of
  3 at a fresh origin/main 733fac48f), TestMainWindowCorners/macOS_26_SDK
  (#3949, macOS 27) and TestColdTurnsTaken once in the package run,
  ok when run again (#4510). go vet ./..., GOOS=linux go vet -tags
  nogui ./..., GOOS=windows go vet ./..., go build and GOOS=windows
  go build: ok. gofmt -l prints nothing.
- Broken by hand: the old PNGs, winres.json and the old 64px picture
  as the tray's .ico: TestWindowsIconsFillTheirSquare red, "tile
  (25,25)-(231,231) in (0,0)-(256,256), want at least 15/16 of the
  side, centred" and the same for each size, "icon-windows.ico has no
  16px picture".
- make release-windows on mote at origin/main and at this change, both
  exes on the Windows 11 box (xiaomi-gpu). Its console was locked at
  the PIN screen, so no desktop screenshot: instead Windows itself
  drew each exe and a .lnk to it through IShellItemImageFactory (what
  Explorer, the taskbar and Start use) at 16/24/32/48/256, beside
  Docker Desktop, Claude, Explorer, Edge and Notepad, and the tray
  icon through CreateIconFromResourceEx at 16 to 40 as Wails makes it.
  Before: the tile 80% of the square, the tray blurred. After: the
  tile fills it as Docker's, Claude's and Edge's do; the tray is
  crisp at each size.

Not run: go test -tags nogui ./... (the change is internal/gui's
embeds, which nogui leaves out, and build/).
Not tried: Windows 10 itself, and the real taskbar, tray and Start
with the desktop unlocked. Windows keeps an exe's icon in its icon
cache by path, so a user may see the old one until the cache renews.
2026-11-01 11:02:56 +08:00
yetone 712d3c20ae build: the Windows app's icon group is resource 3, the one Wails gives its window, so the taskbar shows the bird and not a blank page (#1777)
Wails v3 sets a Windows window's icon from the icon group with numeric
resource ID 3 (NewIconFromResource(GetModuleHandle(""), 3) in
webview_window_windows.go). build/windows/winres.json named the group
"APP", and go-winres makes a numeric ID only of a "#n" key, so the exe
had no group 3: the window got no icon, and the taskbar and Alt-Tab drew
Windows' blank page. The group is now "#3".

internal/cli/winres_test.go fails while the group isn't under "#3".

Run:
- go-winres v0.3.3 make as the Makefile's release-windows, an amd64 build
  of each on the Windows box (yeton@10.0.0.132): the new exe has group 3
  and LoadImage(3) succeeds; the old one has neither.
- TestWindowsIconIsResourceThree red on the old winres.json, green now.
- gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./..., sandboxed go test ./... at the rebased head.
Not run: the taskbar of the running app seen with the eye; the release
build (signed) wasn't made.
2026-10-12 22:55:22 +08:00
yetone 75cb192647 Desktop app for Windows and Linux
The Windows app cross-compiles (WebView2, no cgo) as a GUI program with an
icon, version info and a DPI-aware manifest; run from a terminal with a
command it borrows the console. The Linux app links GTK 3 and WebKitGTK
4.1. Off the Mac the app updates its own binary from its own build:
downloaded in the background, swapped in on restart or quit, and the
relaunched process waits for the old one before taking the gateway. The
window leaves room for traffic lights only on a Mac.
2026-09-24 03:22:02 +08:00