跳转至内容
Tauri

@tauri-apps/plugin-positioner

枚举类型

位置

已知的窗口位置。

枚举成员

底部中心
BottomCenter: 5;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L18

底部左侧
BottomLeft: 2;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L15

底部右侧
BottomRight: 3;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L16

中心
Center: 8;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L21

左侧中心
LeftCenter: 6;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L19

右侧中心
RightCenter: 7;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L20

顶部中心
TopCenter: 4;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L17

顶部左侧
TopLeft: 0;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L13

顶部右侧
TopRight: 1;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L14

托盘底部中心
TrayBottomCenter: 14;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L27

托盘底部左侧
TrayBottomLeft: 10;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L23

托盘底部右侧
TrayBottomRight: 12;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L25

托盘中心
TrayCenter: 13;

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L26

托盘左侧
TrayLeft: 9;

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L22

托盘右侧
TrayRight: 11;

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L24

函数

handleIconState()

function handleIconState(event): Promise<void>

参数

参数类型
事件TrayIconEvent

返回值

Promise<void>

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L55


moveWindow()

function moveWindow(to): Promise<void>

使用 WindowExt.move_window() 将窗口移动到指定的 位置。所有位置均相对于 当前 屏幕。

参数

参数类型描述
位置要移动到的 位置

返回值

Promise<void>

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L36


moveWindowConstrained()

function moveWindowConstrained(to): Promise<void>

使用 WindowExt.move_window_constrained() 将窗口移动到指定的 位置

此移动操作将在托盘图标位置的情况下将窗口约束在屏幕尺寸内。

参数

参数类型描述
位置要移动到的(托盘)位置

返回值

Promise<void>

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L49


© 2025 Tauri 贡献者。CC-BY / MIT