Add fullscreen icon on the front mage
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { MailIcon, WalletIcon } from "lucide-svelte";
|
import { MailIcon, MaximizeIcon, WalletIcon } from "lucide-svelte";
|
||||||
import { isTauri, openURL } from "src/ts/storage/globalApi";
|
import { isTauri, openURL, toggleFullscreen } from "src/ts/storage/globalApi";
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -27,4 +27,11 @@
|
|||||||
}}>
|
}}>
|
||||||
<MailIcon size={24} />
|
<MailIcon size={24} />
|
||||||
</button>
|
</button>
|
||||||
|
{#if !isTauri}
|
||||||
|
<button class="text-textcolor" on:click={() => {
|
||||||
|
toggleFullscreen()
|
||||||
|
}}>
|
||||||
|
<MaximizeIcon size={24} />
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -1468,4 +1468,8 @@ export async function fetchNative(url:string, arg:{
|
|||||||
|
|
||||||
export function textifyReadableStream(stream:ReadableStream<Uint8Array>){
|
export function textifyReadableStream(stream:ReadableStream<Uint8Array>){
|
||||||
return new Response(stream).text()
|
return new Response(stream).text()
|
||||||
|
}
|
||||||
|
|
||||||
|
export function toggleFullscreen(){
|
||||||
|
document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen()
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user