-
Notifications
You must be signed in to change notification settings - Fork 29
/
App.vue
114 lines (112 loc) · 3.6 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<script setup lang="ts">
import LogoSvg from "./components/LogoSvg.vue"
import Menu from "./components/Menu.vue"
import ThemeSwitch from "./components/ThemeSwitch.vue"
import { WindowControls, WindowTitlebar } from "./tauri-controls"
type platform = "windows" | "macos" | "gnome"
const platforms: platform[] = ["windows", "macos", "gnome"]
</script>
<template>
<div
className="h-screen overflow-auto bg-slate-200 text-black/90 dark:bg-slate-900 dark:text-white"
>
<div class="flex w-[960px] flex-col space-y-3 px-14 py-6">
<ThemeSwitch />
<span class="w-fit rounded bg-violet-200/20 px-2 font-mono">
@tauri-controls/vue
</span>
<span
class="w-fit border-b border-slate-400 pb-1 pr-10 text-lg font-semibold dark:border-slate-600"
>
WindowControls
</span>
<!-- {/* OnlyControls */} -->
<div
class="flex w-fit space-x-3 rounded-xl border border-dashed border-slate-400 p-3 shadow dark:border-slate-600"
>
<WindowControls
v-for="platform in platforms"
:key="platform"
:platform="platform"
/>
</div>
justify=true:
<div class="flex border" data-tauri-drag-region>
<WindowControls platform="windows" justify />
</div>
<div class="flex border" data-tauri-drag-region>
<WindowControls platform="macos" justify />
</div>
<span
class="w-fit border-b border-slate-400 pb-1 pr-10 text-lg font-semibold dark:border-slate-600"
>
WindowTitlebar
</span>
<WindowTitlebar class="border">content</WindowTitlebar>
<!-- {/* Icon+Title Controls */} -->
<WindowTitlebar
controlsOrder="platform"
v-for="platform in platforms"
:key="platform"
:windowControlsProps="{ platform }"
class="h-10 rounded-t-lg border border-dashed border-slate-400 bg-white shadow dark:border-slate-600 dark:bg-slate-800"
>
<div
class="flex h-full w-full items-center justify-center"
data-tauri-drag-region
>
<LogoSvg />
Title
</div>
</WindowTitlebar>
<!-- {/* Icon Menu Title Controls */} -->
<WindowTitlebar
v-for="platform in platforms"
:key="platform"
:windowControlsProps="{ platform }"
controlsOrder="platform"
class="h-10 rounded-t-lg bg-white shadow dark:bg-slate-800"
data-tauri-drag-region
>
<div class="ml-3 flex items-center" data-tauri-drag-region>
<LogoSvg />
<Menu />
</div>
<div
class="flex w-full items-center justify-center"
data-tauri-drag-region
>
Title
</div>
</WindowTitlebar>
<WindowTitlebar
data-tauri-drag-region
controlsOrder="right"
:windowControlsProps="{
platform: 'macos',
className: 'bg-rose-700 rounded-full p-2',
}"
>
<div
class="flex items-center justify-center rounded-full bg-sky-500 px-2"
>
titlebar content without w-full (macos but on the right side)
</div>
</WindowTitlebar>
<WindowTitlebar
data-tauri-drag-region
controlsOrder="left"
:windowControlsProps="{
platform: 'windows',
className: 'bg-rose-700 rounded-full overflow-hidden',
}"
>
<div
class="flex items-center justify-center rounded-full bg-sky-500 px-2"
>
titlebar content without w-full (windows but on the left side)
</div>
</WindowTitlebar>
</div>
</div>
</template>