| |
| |
| |
| |
|
|
| import { invoke } from '@tauri-apps/api/core' |
| import type { TrayIconEvent } from '@tauri-apps/api/tray' |
|
|
| |
| |
| |
| export enum Position { |
| TopLeft = 0, |
| TopRight, |
| BottomLeft, |
| BottomRight, |
| TopCenter, |
| BottomCenter, |
| LeftCenter, |
| RightCenter, |
| Center, |
| TrayLeft, |
| TrayBottomLeft, |
| TrayRight, |
| TrayBottomRight, |
| TrayCenter, |
| TrayBottomCenter |
| } |
|
|
| |
| |
| |
| |
| |
| |
| export async function moveWindow(to: Position): Promise<void> { |
| await invoke('plugin:positioner|move_window', { |
| position: 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, |
| size: event.rect.size |
| }) |
| } |
|
|