fix: re-add minimise button

This commit is contained in:
DecDuck
2025-05-10 14:22:21 +10:00
parent d83434a2ba
commit 4027ec4da2
3 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -42,7 +42,7 @@
</ol> </ol>
</div> </div>
</div> </div>
<WindowControl class="h-16 w-16 p-4" /> <WindowControl />
</div> </div>
</template> </template>
+1 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<button class="transition h-10 w-10 text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100 p-2"> <button class="transition h-full aspect-square text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100 p-[1.1rem]">
<slot /> <slot />
</button> </button>
</template> </template>
+11 -5
View File
@@ -1,4 +1,7 @@
<template> <template>
<HeaderButton v-if="showMinimise" @click="() => minimise()">
<MinusIcon />
</HeaderButton>
<HeaderButton @click="() => close()"> <HeaderButton @click="() => close()">
<XMarkIcon /> <XMarkIcon />
</HeaderButton> </HeaderButton>
@@ -8,11 +11,14 @@
import { MinusIcon, XMarkIcon } from "@heroicons/vue/16/solid"; import { MinusIcon, XMarkIcon } from "@heroicons/vue/16/solid";
import { getCurrentWindow } from "@tauri-apps/api/window"; import { getCurrentWindow } from "@tauri-apps/api/window";
async function close(){ const window = getCurrentWindow();
console.log(window); const showMinimise = await window.isMinimizable();
const result = await window.close();
console.log(`closed window: ${result}`); async function close() {
await window.close();
} }
const window = getCurrentWindow(); async function minimise() {
await window.minimize();
}
</script> </script>