Fixes #12 by remembering the window size

This commit is contained in:
Thorsten Sommer 2024-06-01 12:49:10 +02:00
parent b7dfbbc5bd
commit 906a09442d
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 26 additions and 0 deletions

24
runtime/Cargo.lock generated
View File

@ -326,6 +326,15 @@ version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "bincode"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.3.2" version = "1.3.2"
@ -2199,6 +2208,7 @@ dependencies = [
"serde_json", "serde_json",
"tauri", "tauri",
"tauri-build", "tauri-build",
"tauri-plugin-window-state",
"tokio", "tokio",
] ]
@ -3909,6 +3919,20 @@ dependencies = [
"tauri-utils", "tauri-utils",
] ]
[[package]]
name = "tauri-plugin-window-state"
version = "0.1.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#5e3900e682e13f3759b439116ae2f77a6d389ca2"
dependencies = [
"bincode",
"bitflags 2.5.0",
"log",
"serde",
"serde_json",
"tauri",
"thiserror",
]
[[package]] [[package]]
name = "tauri-runtime" name = "tauri-runtime"
version = "0.14.2" version = "0.14.2"

View File

@ -10,6 +10,7 @@ tauri-build = { version = "1.5", features = [] }
[dependencies] [dependencies]
tauri = { version = "1.6", features = [ "http-all", "shell-sidecar", "path-all", "shell-open"] } tauri = { version = "1.6", features = [ "http-all", "shell-sidecar", "path-all", "shell-open"] }
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
keyring = "2" keyring = "2"

View File

@ -187,6 +187,7 @@ fn main() {
*main_window.lock().unwrap() = Some(window); *main_window.lock().unwrap() = Some(window);
Ok(()) Ok(())
}) })
.plugin(tauri_plugin_window_state::Builder::default().build())
.invoke_handler(tauri::generate_handler![store_secret, get_secret, delete_secret, set_clipboard]) .invoke_handler(tauri::generate_handler![store_secret, get_secret, delete_secret, set_clipboard])
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("Error while running Tauri application"); .expect("Error while running Tauri application");