mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-29 13:03:09 +03:00
docs: add maximize toggle to window_customization guide (#2132)
This commit is contained in:
parent
3e6f34160d
commit
373e2ba318
@ -8,11 +8,9 @@ Tauri provides lots of options for customizing the look and feel of your app's w
|
|||||||
|
|
||||||
There are three ways to change the window configuration:
|
There are three ways to change the window configuration:
|
||||||
|
|
||||||
TODO: LINKS
|
|
||||||
|
|
||||||
- [Through tauri.conf.json](https://tauri.studio/en/docs/api/config/#tauri.windows)
|
- [Through tauri.conf.json](https://tauri.studio/en/docs/api/config/#tauri.windows)
|
||||||
- [Through the JS API]
|
- [Through the JS API](https://tauri.studio/en/docs/api/js/classes/window.windowmanager)
|
||||||
- [Through the Window in Rust]
|
- [Through the Window in Rust](https://tauri.studio/en/docs/api/js/classes/window.windowmanager)
|
||||||
|
|
||||||
## Creating a Custom Titlebar
|
## Creating a Custom Titlebar
|
||||||
|
|
||||||
@ -76,7 +74,6 @@ Note that you may need to move the rest of your content down so that the titleba
|
|||||||
|
|
||||||
Finally, you'll need to make the buttons work:
|
Finally, you'll need to make the buttons work:
|
||||||
|
|
||||||
TODO: TOGGLE MAXIMIZE
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { appWindow } from '@tauri-apps/api/window'
|
import { appWindow } from '@tauri-apps/api/window'
|
||||||
@ -85,7 +82,7 @@ document
|
|||||||
.addEventListener('click', () => appWindow.minimize())
|
.addEventListener('click', () => appWindow.minimize())
|
||||||
document
|
document
|
||||||
.getElementById('titlebar-maximize')
|
.getElementById('titlebar-maximize')
|
||||||
.addEventListener('click', () => appWindow.maximize())
|
.addEventListener('click', async () => await appWindow.isMaximized() ? appWindow.unmaximmize() : appWindow.maximize())
|
||||||
document
|
document
|
||||||
.getElementById('titlebar-close')
|
.getElementById('titlebar-close')
|
||||||
.addEventListener('click', () => appWindow.close())
|
.addEventListener('click', () => appWindow.close())
|
||||||
|
Loading…
Reference in New Issue
Block a user