mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-20 21:20:42 +02:00
[positioner] handleIconState in JS (#1822)
* [positioner] handleIconState in JS * update readme * fix change file version * fixes --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
co-authored by
Lucas Nogueira
parent
30bcf5dcc2
commit
2f7e32b5e0
@@ -4,6 +4,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
import type { TrayIconEvent } from '@tauri-apps/api/tray'
|
||||
|
||||
/**
|
||||
* Well known window positions.
|
||||
@@ -37,3 +38,14 @@ export async function moveWindow(to: Position): Promise<void> {
|
||||
position: to
|
||||
})
|
||||
}
|
||||
|
||||
export async function handleIconState(event: TrayIconEvent): Promise<void> {
|
||||
await invokeSetTrayIconState(event.rect)
|
||||
}
|
||||
|
||||
async function invokeSetTrayIconState(rect: TrayIconEvent['rect']) {
|
||||
await invoke('plugin:positioner|set_tray_icon_state', {
|
||||
position: rect.position,
|
||||
size: rect.size
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user