Skip to content

Commit

Permalink
Merge pull request #28 from totono/25-画面位置記憶が動作していないv020
Browse files Browse the repository at this point in the history
画面リサイズ時にサイズと位置を保存するように
  • Loading branch information
totono authored Mar 30, 2023
2 parents 2a23c2d + 5eeb168 commit 526fcbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use query::{task_list};
use store::AppState;
use system_tray::{create_system_tray, system_tray_event};
use tauri::Manager;
use tauri_plugin_window_state::{AppHandleExt, StateFlags};

mod mutation;
mod query;
Expand Down Expand Up @@ -45,12 +46,16 @@ fn main() {
Ok(())
})
.on_window_event(|event| {
let window = event.window().get_window("main").expect("falied to get window");
if let tauri::WindowEvent::CloseRequested { api, .. } = event.event() {
event.window().minimize().unwrap();
let window = event.window().get_window("main").expect("falied to get window");
window.set_skip_taskbar(true).unwrap();
api.prevent_close();
}
if let tauri::WindowEvent::Resized(_) = event.event() {
let _ = event.window().app_handle().save_window_state(StateFlags::all());
}

})
.invoke_handler(tauri::generate_handler![
task_list,
Expand Down

0 comments on commit 526fcbd

Please sign in to comment.