toggle fullscreen?
This commit is contained in:
parent
7373f30ddc
commit
2b6080ba7e
@ -13,8 +13,8 @@
|
||||
"windows": [
|
||||
{
|
||||
"title": "skrivert",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"width": 1080,
|
||||
"height": 720,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import type { ExpanderType } from "./index.d.ts";
|
||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||
|
||||
let fullscreen = true;
|
||||
export const defaultExpanders: Map<string, ExpanderType> = new Map();
|
||||
export const hotkeys: Map<string, any> = new Map();
|
||||
|
||||
@ -82,6 +84,26 @@ hotkeys.set("F1", {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
hotkeys.set("F11", {
|
||||
action: (e) => {
|
||||
e.preventDefault()
|
||||
console.log("Toggle fullscreen")
|
||||
if (fullscreen) {
|
||||
getCurrentWindow().setFullscreen(false).then(() => {
|
||||
fullscreen = false
|
||||
|
||||
|
||||
});
|
||||
} else {
|
||||
getCurrentWindow().setFullscreen(true).then(() => {
|
||||
fullscreen = true
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
hotkeys.set("F12", {
|
||||
action: (e) => {
|
||||
e.preventDefault()
|
||||
|
Loading…
x
Reference in New Issue
Block a user