fix(positioner): pass correct values through IPC (#1858)

* fix(positioner): pass correct values through IPC

followup to https://github.com/tauri-apps/plugins-workspace/pull/1822

* build api & remove packageManager field
This commit is contained in:
Amr Bashir
2024-10-02 08:28:28 -03:00
committed by GitHub
parent 58eab11faf
commit 654a7299c3
31 changed files with 82 additions and 72 deletions
+13 -5
View File
@@ -40,12 +40,20 @@ export async function moveWindow(to: Position): Promise<void> {
}
export async function handleIconState(event: TrayIconEvent): Promise<void> {
await invokeSetTrayIconState(event.rect)
}
const size = {} as Record<string, unknown>
size[`${event.rect.size.type}`] = {
width: event.rect.size.width,
height: event.rect.size.height
}
const position = {} as Record<string, unknown>
position[`${event.rect.position.type}`] = {
x: event.rect.position.x,
y: event.rect.position.y
}
async function invokeSetTrayIconState(rect: TrayIconEvent['rect']) {
await invoke('plugin:positioner|set_tray_icon_state', {
position: rect.position,
size: rect.size
position,
size
})
}