@setoelkahfi / svara / commits / 946f0e6

add tab

mellbacon committed May 7, 2023 at 00:58 UTC 946f0e6190f6e629d8ea0bfaa2ed59a6f231bebd
1 file changed +9 -3
src/lib/Header.svelte
+9 -3
@@ -2,10 +2,11 @@
2 import { appWindow } from "@tauri-apps/api/window";
3 import Dropdown from "./utility/Dropdown.svelte";
4 import Settings from "carbon-icons-svelte/lib/Settings.svelte";
5 + import { addTab } from "./scripts/Tab";
6
7 const items = [
8 {menuname: "File", children: [
8 - {name: "New File", shortcut: "Ctrl + N", action: () => {console.log("click")}},
9 + {name: "New File", shortcut: "Ctrl + N", action: () => {addTab()}},
10 {name: "Open File...", shortcut: "Ctrl + O", action: () => {console.log("click")}},
11 {name: "Save File", shortcut: "Ctrl + S", action: () => {console.log("click")}},
12 {name: "Save File As...", shortcut: "Ctrl + Shift + S", action: () => {console.log("click")}},
@@ -61,14 +62,18 @@
62 {/each}
63 </div>
64 <div class="divider"></div>
64 - <div id="workspace" title="path/to/deez/nuts/or/something/filename.txt">
65 + <div id="workspace" title="filename.txt">
66 filename.txt
67 </div>
68 <div id="handle" data-tauri-drag-region></div>
69 <div class="tools">
70
71 <div class="settings">
71 - <Dropdown right menu={{icon: Settings, children: [{name: "Settings", shortcut: "", action: () => {console.log("click")}}, {name: "Keymap", disabled: true, shortcut: "", action: () => {console.log("click")}}]}} />
72 + <Dropdown right menu={{icon: Settings, children: [
73 + {name: "Settings", shortcut: "", action: () => {addTab("Settings", "Settings")}},
74 + {name: "Keymap", disabled: true, shortcut: "", action: () => {console.log("click")}}
75 + ]
76 + }} />
77 </div>
78 </div>
79 <div id="window-controls">
@@ -132,6 +137,7 @@
137 padding: 0 0.5rem;
138 font-size: 0.875rem;
139 color: #8c8c8c;
140 + z-index: 10;
141 }
142
143 #handle {