| @@ -0,0 +1,24 @@ |
| 1 | +#![cfg_attr( |
| 2 | + all(not(debug_assertions), target_os = "windows"), |
| 3 | + windows_subsystem = "windows" |
| 4 | +)] |
| 5 | + |
| 6 | +use tauri::Manager; |
| 7 | +use tauri_plugin_positioner::{WindowExt, Position}; |
| 8 | + |
| 9 | +#[tauri::command] |
| 10 | +fn move_window(app: tauri::AppHandle, window_label: String) { |
| 11 | + if let Some(win) = app.get_window(&window_label) { |
| 12 | + let _ = win.move_window(Position::TrayBottomCenter); |
| 13 | + } else { |
| 14 | + eprintln!("Window with label '{}' not found", window_label); |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +fn main() { |
| 19 | + tauri::Builder::default() |
| 20 | + .plugin(tauri_plugin_positioner::init()) |
| 21 | + .invoke_handler(tauri::generate_handler![move_window]) |
| 22 | + .run(tauri::generate_context!()) |
| 23 | + .expect("error while running tauri application"); |
| 24 | +} |