From 373e2ba318bf96f692ee262c1a7fad933cb443d5 Mon Sep 17 00:00:00 2001 From: Amr Bashir <48618675+amrbashir@users.noreply.github.com> Date: Wed, 30 Jun 2021 20:32:38 +0200 Subject: [PATCH] docs: add maximize toggle to window_customization guide (#2132) --- docs/usage/guides/visual/window-customization.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/usage/guides/visual/window-customization.md b/docs/usage/guides/visual/window-customization.md index ba9b2f9ee..ecdbd6d21 100644 --- a/docs/usage/guides/visual/window-customization.md +++ b/docs/usage/guides/visual/window-customization.md @@ -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: -TODO: LINKS - - [Through tauri.conf.json](https://tauri.studio/en/docs/api/config/#tauri.windows) -- [Through the JS API] -- [Through the Window in Rust] +- [Through the JS API](https://tauri.studio/en/docs/api/js/classes/window.windowmanager) +- [Through the Window in Rust](https://tauri.studio/en/docs/api/js/classes/window.windowmanager) ## 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: -TODO: TOGGLE MAXIMIZE ```js import { appWindow } from '@tauri-apps/api/window' @@ -85,7 +82,7 @@ document .addEventListener('click', () => appWindow.minimize()) document .getElementById('titlebar-maximize') - .addEventListener('click', () => appWindow.maximize()) + .addEventListener('click', async () => await appWindow.isMaximized() ? appWindow.unmaximmize() : appWindow.maximize()) document .getElementById('titlebar-close') .addEventListener('click', () => appWindow.close())