@setoelkahfi / svara / commits / 4c51223

Added draggable handle for window

mellobacon committed Oct 21, 2022 at 15:15 UTC 4c512232978b519ead7dda01a2e9bc384ae56348
1 file changed +17 -4
src/components/Header/Header.svelte
+17 -4
@@ -6,7 +6,7 @@
6 import { appWindow } from "@tauri-apps/api/window";
7 import { workspacename } from "../FileTree/scripts/TreeStore";
8 </script>
9 -<div id="header" data-tauri-drag-region>
9 +<div id="header">
10 <div id="logo"></div>
11 <div id="menubar">
12 <Menu name="File" options={filemenu}></Menu>
@@ -24,6 +24,7 @@
24 </HeaderNavMenu>
25 </HeaderNav>
26 </div>
27 + <div id="handle" data-tauri-drag-region></div>
28 <div id="windowcontrols">
29 <div
30 class="window-button"
@@ -62,32 +63,43 @@
63 content: '';
64 background-image: url("/assets/images/Icon\(1\).png");
65 background-position: center;
66 + z-index: 10;
67 }
68 #menubar {
69 height: 100%;
70 display: flex;
71 + z-index: 10;
72 }
73 #workspace {
74 height: 100%;
72 - min-width: 160px;
75 + width: fit-content;
76 + max-width: 200px;
77 overflow-x: clip;
78 + z-index: 10;
79 }
80 :global(#workspace a.bx--header__menu-item) {
81 flex-direction: row-reverse;
82 cursor: pointer;
83 }
84 :global(#workspace .bx--header__menu-arrow) {
80 - margin-right: .5rem;
81 - margin-left: 0 !important;
85 + display: none;
86 }
87 :global(#workspace .bx--header__menu-title.bx--header__menu) {
88 width: 100% !important;
89 }
90
91 + #handle {
92 + position: absolute;
93 + height: 2rem;
94 + width: -webkit-fill-available;
95 + z-index: 9;
96 + }
97 +
98 #windowcontrols {
99 margin-left: auto;
100 height: 100%;
101 display: flex;
102 + z-index: 10;
103 }
104 .window-button {
105 min-width: 47px;
@@ -116,4 +128,5 @@
128 #close:hover {
129 background-color: rgb(255, 49, 49);
130 }
131 +
132 </style>
\ No newline at end of file