Skip to content

Commit

Permalink
feat: update example, focus and show
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Sep 27, 2021
1 parent 60342cf commit ea9a3d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ There are three general methods of installation that we can recommend.
2. Git submodule install this repo in your tauri project and then use `file` protocol to ingest the source
3. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)

For more details and usage see [the vanilla demo](examples/vanilla/src-tauri/src/main.rs). Please note, below in the dependencies you can also lock to a revision/tag in the `Cargo.toml`.
For more details and usage see [the vanilla demo](examples/vanilla/src-tauri/src/main.rs).
Please note, below in the dependencies you can also lock to a revision/tag in the `Cargo.toml`.

`src-tauri/Cargo.toml`
```yaml
Expand All @@ -29,5 +30,8 @@ fn main() {
}
```

To prevent flashes when the window is updated, the window `visible` property must be set to `false`.
The plugin is responsible for showing it after restoring its state.

# License
MIT / Apache-2.0
16 changes: 8 additions & 8 deletions examples/vanilla/src-tauri/Cargo.lock

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

3 changes: 1 addition & 2 deletions examples/vanilla/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
"title": "app",
"width": 800,
"height": 600,
"resizable": true,
"fullscreen": false
"visible": false
}
],
"security": {
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ impl<R: Runtime> Plugin<R> for WindowState {
}))
.unwrap();
}
window.show().unwrap();
window.set_focus().unwrap();
}

fn on_event(&mut self, app: &AppHandle<R>, event: &Event) {
Expand Down

0 comments on commit ea9a3d5

Please sign in to comment.