跳到內容
Tauri

@tauri-apps/plugin-positioner

枚舉

位置

眾所周知的視窗位置。

枚舉成員

BottomCenter
BottomCenter: 5;

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

BottomLeft
BottomLeft: 2;

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

BottomRight
BottomRight: 3;

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

Center
Center: 8;

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

LeftCenter
LeftCenter: 6;

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

RightCenter
RightCenter: 7;

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

TopCenter
TopCenter: 4;

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

TopLeft
TopLeft: 0;

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

TopRight
TopRight: 1;

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

TrayBottomCenter
TrayBottomCenter: 14;

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

TrayBottomLeft
TrayBottomLeft: 10;

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

TrayBottomRight
TrayBottomRight: 12;

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

TrayCenter
TrayCenter: 13;

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

TrayLeft
TrayLeft: 9;

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

TrayRight
TrayRight: 11;

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

函式

handleIconState()

function handleIconState(event): Promise<void>

參數

參數類型
eventTrayIconEvent

回傳

Promise<void>

Source: 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()Window 移動到指定的 Position。所有位置都相對於目前螢幕。

參數

參數類型描述
to位置要移動到的 Position

回傳

Promise<void>

Source: 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()Window 移動到指定的 Position

在 tray-icon 位置的情況下,此移動操作會將視窗限制在螢幕尺寸內。

參數

參數類型描述
to位置要移動到的(tray)Position

回傳

Promise<void>

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


© 2025 Tauri Contributors. CC-BY / MIT