positioner 模块读写当前窗口的位置与大小——Tauri
tauri-plugin-positioner 的移植,但直接落在 plugin:window|*
命令上:getPosition / setPosition 处理窗口左上角坐标,
getFrame 一次拿全 { x, y, width, height },getSize 从 frame
推导 { width, height }(frame 缺失时返回
{ width: 0, height: 0 })。
positioner 是纯前端便捷模块:自身没有专属命令、没有插件构造、
没有 scope,全部调用复用窗口命令
(plugin:window|get_position / set_position / get_frame),
这些命令随框架内建权限注册、由 core:default 集授予(见
窗口)。
setPosition → getPosition 的往返(±3px 容差,窗口系统可能有最小
位移粒度)。摘自 examples/hello/frontend/src/main.ts(锚点
POSITIONER_OK 为其真实运行输出):
与 窗口状态 搭配可做"保存 → 位移 → 恢复"
的几何往返(hello spike 的 6c 段即用 setPosition 制造位移)。
无专属命令(复用 plugin:window|get_position /
set_position / get_frame,授权见 窗口)。
| 复用命令 | API |
|---|---|
| `plugin:window | get_position` |
| `plugin:window | set_position` |
| `plugin:window | get_frame` |
适用版本:ztron 0.3.1