diff --git a/src/title_bar/TitleBar.svelte b/src/title_bar/TitleBar.svelte index 793dbd1..6a3c0f4 100644 --- a/src/title_bar/TitleBar.svelte +++ b/src/title_bar/TitleBar.svelte @@ -7,7 +7,8 @@ const appWindow = getCurrent() - let url = writable('') + const url = writable('') + const isFullScreen = writable(false) async function updateHistory(event: Event) { const button = event.currentTarget as HTMLButtonElement @@ -19,10 +20,16 @@ const minimize = async () => await appWindow.minimize() - const toggleMaximize = () => appWindow.toggleMaximize() + const toggleMaximize = async () => { + await appWindow.toggleMaximize() + isFullScreen.update((fullScreen) => !fullScreen) + } onMount(() => { ;(async () => { + const fullScreen = await appWindow.isFullscreen() + isFullScreen.set(fullScreen) + const unlisten = await listen('url_update', (event) => { const updated_url = event?.payload url.set(updated_url) @@ -109,7 +116,19 @@ on:click={toggleMaximize} class="select-none inline-flex h-7 w-7 justify-center items-center hover:rounded-md hover:bg-zinc-700" > - {@html '❐'} + {#if $isFullScreen} + + + + {:else} + {@html '❐'} + {/if}