From e143921882bcba03279c86c5fe27fb4c889ea8fc Mon Sep 17 00:00:00 2001 From: XiNGRZ Date: Sun, 24 Mar 2024 13:24:19 +0800 Subject: [PATCH] Add menu bar --- src/App.vue | 47 ++++++++---- src/components/AppMenu.vue | 106 ++++++++++++++++++++++++++ src/components/AppMenu/Fullscreen.vue | 18 +++++ src/components/AppMenu/SizeSetter.vue | 27 +++++++ src/components/Editor.vue | 2 +- src/components/Scroller.vue | 2 +- src/composables/useDomEvented.ts | 19 +++++ 7 files changed, 204 insertions(+), 17 deletions(-) create mode 100644 src/components/AppMenu.vue create mode 100644 src/components/AppMenu/Fullscreen.vue create mode 100644 src/components/AppMenu/SizeSetter.vue create mode 100644 src/composables/useDomEvented.ts diff --git a/src/App.vue b/src/App.vue index e22be2e..b9aa9c1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,20 +1,22 @@ @@ -27,6 +29,7 @@ import { import { useEditorStore } from '@/stores/editor'; import { useIconStore } from '@/stores/icon'; +import AppMenu from './components/AppMenu.vue'; import Scroller from './components/Scroller.vue'; import BSMap from './components/BSMap.vue'; import Editor from './components/Editor.vue'; @@ -43,6 +46,20 @@ const iconStore = useIconStore(); overscroll-behavior-x: none; } +.container { + display: flex; + flex-direction: column; + height: 100vh; +} + +.menu { + height: var(--menu-bar-height); +} + +.main { + height: calc(100vh - var(--menu-bar-height)); +} + .resizer { height: 100%; background: #cccccc; diff --git a/src/components/AppMenu.vue b/src/components/AppMenu.vue new file mode 100644 index 0000000..d5e266c --- /dev/null +++ b/src/components/AppMenu.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/src/components/AppMenu/Fullscreen.vue b/src/components/AppMenu/Fullscreen.vue new file mode 100644 index 0000000..7ac6b2a --- /dev/null +++ b/src/components/AppMenu/Fullscreen.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/components/AppMenu/SizeSetter.vue b/src/components/AppMenu/SizeSetter.vue new file mode 100644 index 0000000..b598e78 --- /dev/null +++ b/src/components/AppMenu/SizeSetter.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/Editor.vue b/src/components/Editor.vue index bfa64eb..7fcdd3f 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -1,7 +1,7 @@ diff --git a/src/components/Scroller.vue b/src/components/Scroller.vue index 133f3ce..13aff29 100644 --- a/src/components/Scroller.vue +++ b/src/components/Scroller.vue @@ -33,7 +33,7 @@ function onScroll(): void {