Skip to content

Commit 81af3a6

Browse files
author
skhmt
committed
save window size/location in tauri
1 parent 4fc4fea commit 81af3a6

File tree

9 files changed

+116
-7
lines changed

9 files changed

+116
-7
lines changed

package-lock.json

Lines changed: 20 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "TauriLocalDraw",
33
"private": true,
4-
"version": "0.2.2",
4+
"version": "0.2.3",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -10,6 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@tauri-apps/plugin-window-state": "^2.0.0",
1314
"@tldraw/tldraw": "^3.4.1",
1415
"react": "^18.3.1",
1516
"react-dom": "^18.3.1"

src-tauri/Cargo.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.1.0"
3+
version = "0.2.3"
44
description = "A Tauri App"
55
authors = ["you"]
66
license = ""
@@ -23,3 +23,4 @@ serde = { version = "1.0", features = ["derive"] }
2323
log = "0.4"
2424
tauri = { version = "2.1.0", features = [] }
2525
tauri-plugin-log = "2.0.0-rc"
26+
tauri-plugin-window-state = "2.0.0"

src-tauri/gen/schemas/acl-manifests.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src-tauri/gen/schemas/desktop-schema.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,41 @@
16701670
"description": "Denies the log command without any pre-configured scope.",
16711671
"type": "string",
16721672
"const": "log:deny-log"
1673+
},
1674+
{
1675+
"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",
1676+
"type": "string",
1677+
"const": "window-state:default"
1678+
},
1679+
{
1680+
"description": "Enables the filename command without any pre-configured scope.",
1681+
"type": "string",
1682+
"const": "window-state:allow-filename"
1683+
},
1684+
{
1685+
"description": "Enables the restore_state command without any pre-configured scope.",
1686+
"type": "string",
1687+
"const": "window-state:allow-restore-state"
1688+
},
1689+
{
1690+
"description": "Enables the save_window_state command without any pre-configured scope.",
1691+
"type": "string",
1692+
"const": "window-state:allow-save-window-state"
1693+
},
1694+
{
1695+
"description": "Denies the filename command without any pre-configured scope.",
1696+
"type": "string",
1697+
"const": "window-state:deny-filename"
1698+
},
1699+
{
1700+
"description": "Denies the restore_state command without any pre-configured scope.",
1701+
"type": "string",
1702+
"const": "window-state:deny-restore-state"
1703+
},
1704+
{
1705+
"description": "Denies the save_window_state command without any pre-configured scope.",
1706+
"type": "string",
1707+
"const": "window-state:deny-save-window-state"
16731708
}
16741709
]
16751710
},

src-tauri/gen/schemas/windows-schema.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,41 @@
16701670
"description": "Denies the log command without any pre-configured scope.",
16711671
"type": "string",
16721672
"const": "log:deny-log"
1673+
},
1674+
{
1675+
"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",
1676+
"type": "string",
1677+
"const": "window-state:default"
1678+
},
1679+
{
1680+
"description": "Enables the filename command without any pre-configured scope.",
1681+
"type": "string",
1682+
"const": "window-state:allow-filename"
1683+
},
1684+
{
1685+
"description": "Enables the restore_state command without any pre-configured scope.",
1686+
"type": "string",
1687+
"const": "window-state:allow-restore-state"
1688+
},
1689+
{
1690+
"description": "Enables the save_window_state command without any pre-configured scope.",
1691+
"type": "string",
1692+
"const": "window-state:allow-save-window-state"
1693+
},
1694+
{
1695+
"description": "Denies the filename command without any pre-configured scope.",
1696+
"type": "string",
1697+
"const": "window-state:deny-filename"
1698+
},
1699+
{
1700+
"description": "Denies the restore_state command without any pre-configured scope.",
1701+
"type": "string",
1702+
"const": "window-state:deny-restore-state"
1703+
},
1704+
{
1705+
"description": "Denies the save_window_state command without any pre-configured scope.",
1706+
"type": "string",
1707+
"const": "window-state:deny-save-window-state"
16731708
}
16741709
]
16751710
},

src-tauri/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
33

44
fn main() {
5-
app_lib::run();
5+
tauri::Builder::default()
6+
.plugin(tauri_plugin_window_state::Builder::default().build())
7+
.run(tauri::generate_context!())
8+
.expect("error while running tauri application");
69
}

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
33
"productName": "TauriLocalDraw",
4-
"version": "0.2.2",
4+
"version": "0.2.3",
55
"identifier": "TauriLocalDraw",
66
"mainBinaryName": "tldraw",
77
"build": {

0 commit comments

Comments
 (0)