feat(v2): Gio UI spike, cross-compiles CGo-free for Windows
Adds cmd/gio-spike: a minimal Gio window (dual tabs, an *image.RGBA video area, start/stop) that avoids the Walk TTM_ADDTOOL/comctl manifest problem entirely. Verified via GOOS=windows CGO_ENABLED=0 go build (11MB single exe). Windows visual smoke pending. Existing Walk ui-spike left untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -532,3 +532,12 @@
|
||||
- 阻塞:Gio 依赖需在能联网且 Go≥1.24 的环境 `go get gioui.org`;真实窗口显示需 Windows 目视。
|
||||
- 决策:Gio 不用 Win32 common controls,从根上不存在 `TTM_ADDTOOL`/manifest 问题;`internal/render.Render` 已返回 `*image.RGBA`,Gio 用 `paint.NewImageOp` 直接贴,UI 层很薄;纯 Go 单 exe 符合"无 Go 环境运行"目标且不带 WebView2。新建 `cmd/gio-spike`,不动现有 Walk `cmd/ui-spike`(保留对照)。
|
||||
- 下一步:写 `cmd/gio-spike` 最小窗口(双 Tab + 贴一张 RGBA + 开始/停止按钮),给 Windows 运行命令;据结果决定修 Walk 还是迁 Gio。
|
||||
|
||||
## 【2026-07-23】T-305 V2 UI Gio Spike(交叉编译验证通过,待 Windows 目视)
|
||||
|
||||
- 状态:DOING(代码完成 + 交叉编译验证;窗口目视需 Windows)
|
||||
- 变更:新增 `v2/cmd/gio-spike/main.go`——Gio 最小窗口:浅灰蓝底、顶部双 Tab(实时监控/设置)、贴一张合成 `*image.RGBA`(模拟 render 输出,带 6px 红边)、开始/停止按钮,关闭即退出。不动现有 Walk `cmd/ui-spike`(保留对照)。`go.mod` 加 `gioui.org v0.10.1`,`go.sum` 由 `go mod tidy` 补全。
|
||||
- 验证:本环境为 Go 1.21/无显示,无法运行 Gio;改用 `GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build ./cmd/gio-spike` **交叉编译到 Windows** 对真实 Gio Windows API 做类型检查——`BUILD_EXIT=0`,产出 11 MB 纯 Go 单 exe(CGO_ENABLED=0 通过,证明 Gio 的 Windows 版无需 CGo,符合"无 Go 环境单文件运行"目标)。因此代码对 Windows API 编译无误,`go run ./cmd/gio-spike` 在 Windows 上有高把握能起窗。
|
||||
- 阻塞:窗口能否真正显示/关闭、无 `TTM_ADDTOOL`,需用户在 Windows 目视一次(Gio 不用 Win32 common controls,理论上不会出该错)。
|
||||
- 决策:Gio 从根上规避 Walk 的 comctl/manifest 问题;`internal/render` 已出 `*image.RGBA`,Gio 用 `paint.NewImageOp` 直接贴,UI 层很薄。若 Windows 目视通过,则 V2 UI 由 Walk 迁 Gio;否则回退"给 Walk 嵌 Common Controls v6 清单"方案。
|
||||
- 下一步:用户在 `v2/` 下 `go run ./cmd/gio-spike` 确认起窗;通过则据此把 `internal/ui` 迁 Gio、更新架构文档。
|
||||
|
||||
Reference in New Issue
Block a user