Files
image-workbench-desktop/src-tauri/Cargo.toml
T
qiqi 0d14728224 feat(canvas-webview): 网页节点圆角跟外观设置、长时离屏自动释放、右键菜单按选区折叠
1. 圆角跟随「外观设置 → 节点圆角」
   - cwv_round 增加 base 参数(渲染层读 --iwb-node-radius 后随 bounds 下发),
     ensure / bounds 各加一个 radius: Option<f64>,默认 14。
   - 未选中的节点位置尺寸都不动时,圆角改设置原本要等下一次拖动才生效:
     tick 里每帧用一次 radiusNow() 与 st.pr 比对,变化就主动重推一条 bounds。
   - 半径按 zoom 同比缩放,只在半径/缩放真的变了时投递,正常拖动不增加 IPC。

2. 网页节点长时不可见自动释放(省内存)
   - 每个网页节点是一个独立 WebKit 进程。持续不可见超过 5 分钟(SLEEP_MS)
     就 close 掉视图并保留 URL,回到可见时按原地址 ensure 重建。
   - 释放后不再推 bounds,不留下「已 close 还在 park」的空转。

3. 右键菜单按选区折叠
   - 没有选中节点时整组从「选中操作」变成「画布操作」,只留粘贴/清空剪贴板,
     复制/导出/收藏/删除不渲染(原来 6 项全是灰的,菜单高 678px)。
   - 无选中时菜单高 412px,屏幕下半区右键不再需要内部滚动。

顺带把「该节点」的分隔线+标题合并成一个数组展开,app.js 净减 2 行(8948 → 8946,上限 8947)。

门禁:npm run verify:ci 全绿;Playwright 实测 radius 14→20→8 联动、拖动不重推、
离屏 6 分钟后 close=1 且回屏按原 url 重建、菜单 412/678px。
2026-11-19 08:50:40 +08:00

47 lines
1.7 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[package]
name = "image-workbench"
version = "3.25.29"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
repository = ""
edition = "2024"
rust-version = "1.90"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "image_workbench_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.7.4", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
# tray-icon:系统托盘(关闭窗口收进托盘而不是退出)
# tray-icon:系统托盘;image-png:托盘用单色 PNG 模板图标
# unstable:`Manager::get_window`(窗口级句柄,不受子 webview 影响)与 Window::add_child 都在它下面。
# 画布内嵌网页已下线(v3.25.27),但 get_window 仍要留着 —— save_geom/托盘/单实例都靠它,
# 且它比 get_webview_window 更稳(后者一旦窗口里有非同名 webview 就返回 None,见 v3.25.26)。
tauri = { version = "2.12.5", features = ["tray-icon", "image-png", "unstable"] }
url = "2"
tauri-plugin-log = "2"
tauri-plugin-dialog = "2"
tauri-plugin-fs = "2"
tauri-plugin-http = "2"
tauri-plugin-updater = "2"
tauri-plugin-single-instance = "2"
tauri-plugin-notification = "2"
arboard = "3"
image = { version = "0.25", default-features = false, features = ["png"] }
base64 = "0.22"
# 画布内嵌网页的圆角(2026-11-19):WKWebView 是矩形,要给它 backing layer 设
# cornerRadius/masksToBounds 只能走 Objective-C 消息。objc2 0.6 已由 tauri/wry 引入
# (Cargo.lock 里是同一个 0.6.x),这里显式依赖不会多编译一份。
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6"