mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
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:
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user