mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-26 21:41:48 +02:00
feat(positioner): add moveWindowConstrained for tray-icon positions (#2076)
This commit is contained in:
@@ -39,6 +39,19 @@ export async function moveWindow(to: Position): Promise<void> {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the `Window` to the given {@link Position} using `WindowExt.move_window_constrained()`
|
||||
*
|
||||
* This move operation constrains the window to the screen dimensions in case of
|
||||
* tray-icon positions.
|
||||
* @param to The (tray) {@link Position} to move to.
|
||||
*/
|
||||
export async function moveWindowConstrained(to: Position): Promise<void> {
|
||||
await invoke('plugin:positioner|move_window_constrained', {
|
||||
position: to
|
||||
})
|
||||
}
|
||||
|
||||
export async function handleIconState(event: TrayIconEvent): Promise<void> {
|
||||
await invoke('plugin:positioner|set_tray_icon_state', {
|
||||
position: event.rect.position,
|
||||
|
||||
Reference in New Issue
Block a user