Skip to content

Commit

Permalink
save window size/location in tauri
Browse files Browse the repository at this point in the history
  • Loading branch information
skhmt committed Nov 28, 2024
1 parent 4fc4fea commit 81af3a6
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 7 deletions.
22 changes: 20 additions & 2 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "TauriLocalDraw",
"private": true,
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@tauri-apps/plugin-window-state": "^2.0.0",
"@tldraw/tldraw": "^3.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
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.

3 changes: 2 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "app"
version = "0.1.0"
version = "0.2.3"
description = "A Tauri App"
authors = ["you"]
license = ""
Expand All @@ -23,3 +23,4 @@ serde = { version = "1.0", features = ["derive"] }
log = "0.4"
tauri = { version = "2.1.0", features = [] }
tauri-plugin-log = "2.0.0-rc"
tauri-plugin-window-state = "2.0.0"
2 changes: 1 addition & 1 deletion src-tauri/gen/schemas/acl-manifests.json

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions src-tauri/gen/schemas/desktop-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,41 @@
"description": "Denies the log command without any pre-configured scope.",
"type": "string",
"const": "log:deny-log"
},
{
"description": "This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n",
"type": "string",
"const": "window-state:default"
},
{
"description": "Enables the filename command without any pre-configured scope.",
"type": "string",
"const": "window-state:allow-filename"
},
{
"description": "Enables the restore_state command without any pre-configured scope.",
"type": "string",
"const": "window-state:allow-restore-state"
},
{
"description": "Enables the save_window_state command without any pre-configured scope.",
"type": "string",
"const": "window-state:allow-save-window-state"
},
{
"description": "Denies the filename command without any pre-configured scope.",
"type": "string",
"const": "window-state:deny-filename"
},
{
"description": "Denies the restore_state command without any pre-configured scope.",
"type": "string",
"const": "window-state:deny-restore-state"
},
{
"description": "Denies the save_window_state command without any pre-configured scope.",
"type": "string",
"const": "window-state:deny-save-window-state"
}
]
},
Expand Down
35 changes: 35 additions & 0 deletions src-tauri/gen/schemas/windows-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,41 @@
"description": "Denies the log command without any pre-configured scope.",
"type": "string",
"const": "log:deny-log"
},
{
"description": "This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n",
"type": "string",
"const": "window-state:default"
},
{
"description": "Enables the filename command without any pre-configured scope.",
"type": "string",
"const": "window-state:allow-filename"
},
{
"description": "Enables the restore_state command without any pre-configured scope.",
"type": "string",
"const": "window-state:allow-restore-state"
},
{
"description": "Enables the save_window_state command without any pre-configured scope.",
"type": "string",
"const": "window-state:allow-save-window-state"
},
{
"description": "Denies the filename command without any pre-configured scope.",
"type": "string",
"const": "window-state:deny-filename"
},
{
"description": "Denies the restore_state command without any pre-configured scope.",
"type": "string",
"const": "window-state:deny-restore-state"
},
{
"description": "Denies the save_window_state command without any pre-configured scope.",
"type": "string",
"const": "window-state:deny-save-window-state"
}
]
},
Expand Down
5 changes: 4 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

fn main() {
app_lib::run();
tauri::Builder::default()
.plugin(tauri_plugin_window_state::Builder::default().build())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "TauriLocalDraw",
"version": "0.2.2",
"version": "0.2.3",
"identifier": "TauriLocalDraw",
"mainBinaryName": "tldraw",
"build": {
Expand Down

0 comments on commit 81af3a6

Please sign in to comment.