mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-16 16:47:21 +02:00
feat(positioner): add moveWindowConstrained for tray-icon positions (#2076)
This commit is contained in:
@@ -61,6 +61,15 @@ async fn move_window<R: Runtime>(window: tauri::Window<R>, position: Position) -
|
||||
window.move_window(position)
|
||||
}
|
||||
|
||||
#[cfg(feature = "tray-icon")]
|
||||
#[tauri::command]
|
||||
async fn move_window_constrained<R: Runtime>(
|
||||
window: tauri::Window<R>,
|
||||
position: Position,
|
||||
) -> Result<()> {
|
||||
window.move_window_constrained(position)
|
||||
}
|
||||
|
||||
#[cfg(feature = "tray-icon")]
|
||||
#[tauri::command]
|
||||
fn set_tray_icon_state<R: Runtime>(
|
||||
@@ -80,6 +89,8 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
let plugin = plugin::Builder::new("positioner").invoke_handler(tauri::generate_handler![
|
||||
move_window,
|
||||
#[cfg(feature = "tray-icon")]
|
||||
move_window_constrained,
|
||||
#[cfg(feature = "tray-icon")]
|
||||
set_tray_icon_state
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user