Skip to content

Commit

Permalink
add window state plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Oct 6, 2024
1 parent f34977d commit e657e8a
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
"@tauri-apps/plugin-dialog": "^2.0.0",
"@tauri-apps/plugin-fs": "^2.0.0",
"@tauri-apps/plugin-http": "^2.0.0",
"@tauri-apps/plugin-log": "^2.0.0",
"@tauri-apps/plugin-os": "^2.0.0",
"@tauri-apps/plugin-process": "^2.0.0",
"@tauri-apps/plugin-shell": "^2.0.0",
"@tauri-apps/plugin-updater": "^2.0.0",
"@tauri-apps/plugin-log": "^2.0.0",
"@tauri-apps/plugin-window-state": "~2",
"@tiptap/extension-link": "2.2.4",
"@tiptap/extension-placeholder": "2.2.4",
"@tiptap/extension-underline": "2.2.4",
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ tauri-plugin-cli = "2.0.1"
tauri-plugin-updater = "2.0.1"
tauri-plugin-process = "2"
tauri-plugin-log = "2"
tauri-plugin-window-state = "2"

[features]
# by default Tauri runs in production mode
Expand Down
1 change: 1 addition & 0 deletions src-tauri/capabilities/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"log:default",
"fs:default",
"fs:write-all",
"window-state:default",
{
"identifier": "fs:scope",
"allow": [
Expand Down
6 changes: 1 addition & 5 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ const REQUIRED_FILES: &[(BaseDirectory, &str, &str)] =
#[tauri::command]
#[specta::specta]
async fn close_splashscreen(window: Window) -> Result<(), String> {
window
.get_webview_window("main")
.expect("no window labeled 'main' found")
.maximize()
.unwrap();
window
.get_webview_window("main")
.expect("no window labeled 'main' found")
Expand Down Expand Up @@ -189,6 +184,7 @@ fn main() {
];

tauri::Builder::default()
.plugin(tauri_plugin_window_state::Builder::new().build())
.plugin(tauri_plugin_process::init())
.plugin(
tauri_plugin_log::Builder::default()
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
{
"title": "En Croissant",
"maximized": true,
"visible": true,
"visible": false,
"decorations": true
}
],
Expand Down

0 comments on commit e657e8a

Please sign in to comment.