|
| 1 | +v0.6.6 是 v0.6.5 之后的版本:页面控件补齐单选、标签、分页、拆分按钮、颜色选择与组合框选项,表单、布局和画布组件有了页面版 API;应用侧新增窗口标题、菜单动作结果、拖拽预览与 PCM 音频输出。macOS 是参考平台。有一处签名变化需要迁移,见“注意 · Caveats”。 |
| 2 | + |
| 3 | +v0.6.6 comes after v0.6.5: the page controls gain radio groups, badges, pagination, split buttons, color choices and described combobox options, the form, layout and canvas components get page-first APIs, and applications gain window titles, menu action results, drag previews and PCM audio output. macOS is the reference platform. One signature change needs a migration; see "注意 · Caveats". |
| 4 | + |
| 5 | +## 拿到它 · Getting it |
| 6 | + |
| 7 | +`go get github.com/vivaui/viva@v0.6.6`,需要 Go 1.26 或更新;系统依赖与 v0.6.5 相同,Vulkan 加载器现在只是推荐安装,没有时用 CPU 渲染。每个 Release 附带 `viva` 命令的预编译压缩包、`SHA256SUMS`,以及 Homebrew 与 Scoop 清单(`brew install vivaui/tap/viva`,或 `scoop bucket add vivaui https://github.com/vivaui/homebrew-tap` 后 `scoop install viva`);压缩包没有代码签名或公证,浏览器下载的 macOS 版会被 Gatekeeper 拦下,brew、curl 与 `go install` 不受影响。 |
| 8 | + |
| 9 | +`go get github.com/vivaui/viva@v0.6.6` needs Go 1.26 or newer; the system requirements are those of v0.6.5, with the Vulkan loader now a recommendation whose absence falls back to CPU rendering. Every Release carries prebuilt archives of the `viva` command, `SHA256SUMS`, and Homebrew and Scoop manifests (`brew install vivaui/tap/viva`, or `scoop bucket add vivaui https://github.com/vivaui/homebrew-tap` then `scoop install viva`); the archives are not code-signed or notarized, so a browser download on macOS is stopped by Gatekeeper while brew, curl and `go install` are not affected. |
| 10 | + |
| 11 | +## 有什么 · What is in it |
| 12 | + |
| 13 | +- `ui.Radio` 与 `ui.RadioGroup` 在页面里做单选,`ui.RadioID` 给应用命名的选项一个身份。 |
| 14 | +- `ui.Badge`、`ui.Pagination`、`ui.SplitButton` 与 `ui.Kbd` 覆盖标签、分页、拆分操作和快捷键按键提示。 |
| 15 | +- `ui.AlertDialog` 提供确认对话框;`ui.Dialog` 不设高度时按应用绘制的主体决定高度。 |
| 16 | +- `ui.ColorSwatch` 与 `ui.ColorPicker` 让页面选择颜色,`ColorPickerState.Draft` 让预览跟随拖动。 |
| 17 | +- `ui.ComboboxItems` 为每个选项给出说明、搜索文本与禁用状态,`ui.Select` 可以用 `DisabledOptions` 禁用单个选项,并用 `XSmall` 画更短的触发器。 |
| 18 | +- `ui.Checkbox.Mixed` 表达部分选中,`ui.Toggle` 是带样式的开关,`ui.RangeSlider` 是两个拇指的范围滑块。 |
| 19 | +- `ui.List` 的拖动可以从行的手柄开始,Alt 加方向键移动行,焦点留在移动后的手柄上。 |
| 20 | +- `ui.FormField` 与 `ui.Field` 支持说明、错误、无效、禁用与提示,`FormField` 可以标出它命名的控件。 |
| 21 | +- `ui.Box.ButtonRecipe` 与 `SwitchRecipe` 让单个按钮或开关使用自己的外观,而不是页面统一的 `Styles`。 |
| 22 | +- `AlwaysScrollbars` 保留滚动条的槽位,滚动条在指针离开后停留并淡出,菜单行与滚动条值可以被辅助技术读出。 |
| 23 | +- 弹出层与抽屉在窗口边缘内夹住,弹出层可以带自己的圆角与锚点偏移。 |
| 24 | +- `ui.OpenWindow` 从页面打开自己的窗口,`Page.RouteWheel` 把滚轮交给页面而不落回窗口的 `OnScroll`。 |
| 25 | +- 表单、布局与画布组件有了 `ui/<组件>` 的页面版 API,例如 `ui/chart`、`ui/buttongroup`、`ui/calendar`,只在被导入时链接。 |
| 26 | +- 新增可选的 `ui/multiselect` 与 `ui/hierarchypicker` 控件包。 |
| 27 | +- `components` 新增可组合的头像裁剪编辑器。 |
| 28 | +- `Window.SetTitle` 在 macOS、Windows、X11 与无头后端设置窗口标题。 |
| 29 | +- `MenuBarItem.OnSelect` 返回 `gfx.EventResult`,菜单命令的焦点、剪贴板与重绘应用到当前窗口,菜单快捷键先交给焦点控件处理。 |
| 30 | +- `Application.OpenDragPreview` 显示跟随拖动的透明预览窗口。 |
| 31 | +- `audio` 包把 PCM 播放到系统默认输出设备:macOS 用 AudioUnit,Windows 用 WASAPI 共享模式,Linux 用 ALSA 默认插件。 |
| 32 | +- `window`、`base` 与 `style` 包公开窗口契约、页面引擎与样式层,`ui` 仍是写页面的入口。 |
| 33 | +- Web 部署用 WebGL2 渲染,不支持时回退 Canvas2D。 |
| 34 | +- 安装包把 Vulkan 加载器当作可选项,`viva doctor` 会把缺少加载器报告为 CPU 渲染说明。 |
| 35 | +- Linux 上合成桌面没有同步缩放时仍绘制窗口框,隐藏与窗口管理器的竞争会报告正确的可见性。 |
| 36 | +- Linux 上 GTK 组合被取消时保留选区,只含图片的 X11 剪贴板可以粘贴,CPU 渲染器会缩放位图。 |
| 37 | +- Linux 上在 XDG 配置目录查找 Vulkan ICD,只读编辑器在第一次按键前恢复输入,Wayland 内容点击后保留键盘与输入法。 |
| 38 | +- Windows 上隐藏窗口的唤醒不再等 `WM_PAINT`,实时缩放保持响应且不拉伸内容。 |
| 39 | +- Windows 上安装时替换被程序加载的原生文件,更新在退出前暂存补丁载荷。 |
| 40 | +- macOS 上双击选中单词、三击选中整行,建议的保存扩展名保持完整。 |
| 41 | +- 文本编辑与代码行保留 CRLF 行尾。 |
| 42 | +- memo 重放保留完整的命中语义、命中文本与无效状态,禁用控件仍能接收次要按键。 |
| 43 | +- `ui.Tabs` 按给定的高度绘制,上下文菜单从焦点控件取方向键,`ui.Radio` 的标签放不下时以省略号结尾。 |
| 44 | +- 场景与渲染只在删除节点时收缩保留实例,无障碍镜像只重建变化的语义,页面没有用到的控件画笔不链接。 |
| 45 | + |
| 46 | +- `ui.Radio` and `ui.RadioGroup` offer a single choice in a page, and `ui.RadioID` names an option the application identifies. |
| 47 | +- `ui.Badge`, `ui.Pagination`, `ui.SplitButton` and `ui.Kbd` cover labels, page items, a joined action and a menu, and shortcut keycaps. |
| 48 | +- `ui.AlertDialog` gives a page a confirmation dialog; a `ui.Dialog` with no height is as tall as the body the application paints. |
| 49 | +- `ui.ColorSwatch` and `ui.ColorPicker` let a page choose colors, and `ColorPickerState.Draft` makes the preview follow the drag. |
| 50 | +- `ui.ComboboxItems` gives every option a detail, search text and disabled state, and `ui.Select` disables single options with `DisabledOptions` and draws a shorter trigger with `XSmall`. |
| 51 | +- `ui.Checkbox.Mixed` shows a partial choice, `ui.Toggle` is a styled switch, and `ui.RangeSlider` is a two-thumb range. |
| 52 | +- A `ui.List` drag can start on a row's handle, and Alt with the arrow keys moves a row while the focus stays on the handle it moved. |
| 53 | +- `ui.FormField` and `ui.Field` take a description, an error, the invalid look, disabled and a hint, and `FormField` labels the control it names. |
| 54 | +- `ui.Box.ButtonRecipe` and `SwitchRecipe` give one button or switch its own look instead of the page's `Styles`. |
| 55 | +- `AlwaysScrollbars` keeps a scroll area's gutter, a bar lingers and fades after the pointer leaves, and menu rows and scrollbar values reach assistive technology. |
| 56 | +- Popovers and drawers stay clear of the page edges, and a popover can carry its own radius and anchor offset. |
| 57 | +- `ui.OpenWindow` opens a page's own window, and `Page.RouteWheel` gives the wheel to the page without falling back into the window's `OnScroll`. |
| 58 | +- The form, layout and canvas components have page-first APIs in `ui/<component>`, such as `ui/chart`, `ui/buttongroup` and `ui/calendar`, linked only when imported. |
| 59 | +- `ui/multiselect` and `ui/hierarchypicker` are new opt-in page controls. |
| 60 | +- `components` gains a composable avatar crop editor. |
| 61 | +- `Window.SetTitle` sets the window title on macOS, Windows, X11 and the headless backends. |
| 62 | +- `MenuBarItem.OnSelect` returns a `gfx.EventResult`; the runtime applies the focus, clipboard and repaint a menu command returns to the active window, and a menu shortcut is offered to the focused control first. |
| 63 | +- `Application.OpenDragPreview` shows a transparent preview window that follows a drag. |
| 64 | +- Package `audio` plays PCM on the default output device: an AudioUnit on macOS, WASAPI shared mode on Windows and ALSA's default plugin on Linux. |
| 65 | +- Packages `window`, `base` and `style` publish the window contracts, the page engine and the styled layer, and `ui` stays how a page is written. |
| 66 | +- Web deployments render with WebGL2 and fall back to Canvas2D. |
| 67 | +- The packages treat the Vulkan loader as optional, and `viva doctor` reports a missing loader as a CPU-rendering note. |
| 68 | +- On Linux a compositing desktop without synced resize still draws the frame, and Hide racing the window manager reports the correct visibility. |
| 69 | +- On Linux a cancelled GTK preedit keeps its selection, an image-only X11 clipboard can be pasted, and the CPU renderer scales bitmaps. |
| 70 | +- On Linux the Vulkan ICD search covers XDG config directories, a read-only editor restores input before the first key, and Wayland keeps the keyboard and IME after a content click. |
| 71 | +- On Windows a hidden window's wake no longer waits for `WM_PAINT`, and a live resize stays responsive without stretching the content. |
| 72 | +- On Windows an install replaces the native files a running program loaded, and an update stages its patch payload before quitting. |
| 73 | +- On macOS a double-click selects a word and a triple-click the line, and a suggested save extension is kept intact. |
| 74 | +- Line editing and code rows keep CRLF line endings. |
| 75 | +- A memo replay keeps the complete hit semantics, the hit texts and the invalid state, and a disabled control still takes a secondary press. |
| 76 | +- `ui.Tabs` paints at the height it is given, a context menu takes the arrow keys from the focused control, and a `ui.Radio` label ends with an ellipsis when it does not fit. |
| 77 | +- The scene and render paths shrink retained instances only on deletion, the accessibility mirror rebuilds only the semantics a repaint changed, and a page links only the control painters it uses. |
| 78 | + |
| 79 | +## 注意 · Caveats |
| 80 | + |
| 81 | +- `MenuBarItem.OnSelect` 的签名从 `func()` 变为 `func() gfx.EventResult`:每个菜单项返回命令的结果,没有变化时返回 `gfx.EventResult{}`。编译器会指出需要改的入口。 |
| 82 | +- 通过窗口自己的 `OnScroll` 把滚轮转给页面的宿主,改用 `Page.RouteWheel`;否则页面会把同一个事件交回正在路由它的处理器。 |
| 83 | + |
| 84 | +- `MenuBarItem.OnSelect` changed from `func()` to `func() gfx.EventResult`: every entry returns what its command did, and `gfx.EventResult{}` when it changes nothing. The compiler points at each entry to update. |
| 85 | +- A host whose own `OnScroll` forwards the wheel to the page calls the new `Page.RouteWheel`; otherwise the page hands the same event back to the handler already routing it. |
0 commit comments