From 7de2df6ad046be093f936a295bbf69644645b2f2 Mon Sep 17 00:00:00 2001 From: botvid Date: Tue, 11 Feb 2025 08:03:31 +0100 Subject: [PATCH] =?UTF-8?q?F11=20funkar=20i=20webbl=C3=A4saren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/keyboard.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/modules/keyboard.ts b/src/modules/keyboard.ts index ebb10fb..273dfd7 100644 --- a/src/modules/keyboard.ts +++ b/src/modules/keyboard.ts @@ -1,4 +1,5 @@ import { goto } from '$app/navigation'; +import { PUBLIC_TAURI } from '$env/static/public'; import type { ExpanderType } from "./index.d.ts"; import { getCurrentWindow } from "@tauri-apps/api/window"; import { incTextSize, decTextSize, selectNextColor, toggleMenuOpen, appState } from "$lib/stores.svelte" @@ -136,19 +137,22 @@ hotkeys.set("F2", { hotkeys.set("F11", { action: (e) => { - e.preventDefault() console.log("Toggle fullscreen") - if (fullscreen) { - getCurrentWindow().setFullscreen(false).then(() => { - fullscreen = false + console.log(PUBLIC_TAURI) + if(PUBLIC_TAURI == true) { + e.preventDefault() + if (fullscreen) { + getCurrentWindow().setFullscreen(false).then(() => { + fullscreen = false - - }); - } else { - getCurrentWindow().setFullscreen(true).then(() => { - fullscreen = true + + }); + } else { + getCurrentWindow().setFullscreen(true).then(() => { + fullscreen = true - }); + }); + } } } })