feature/tauri-v2
svelte 60 lines 1.5 KB
Raw
1 <script lang="ts">
2 import { onDestroy, onMount } from "svelte";
3 import { treeLoading, dirToLoad, dirLoadFail } from "./File";
4 import ProgressBar from "./utility/ProgressBar.svelte";
5 import { updateTablistWidth } from "./EditorTabList.svelte";
6
7 export let content = null;
8
9 onMount(() => {
10 updateTablistWidth();
11 })
12
13 onDestroy(() => {
14 updateTablistWidth();
15 })
16 </script>
17 <div id="sidebarview">
18 {#if content}
19 <div id="tool-view">
20 <svelte:component this={content}></svelte:component>
21 </div>
22 {/if}
23 {#if $treeLoading}
24 <div class="loading-container">
25 <ProgressBar label="{$dirToLoad}..." fail={$dirLoadFail}></ProgressBar>
26 </div>
27 {/if}
28 </div>
29
30 <style lang="scss">
31 #sidebarview {
32 height: 100%;
33 display: flex;
34 flex-direction: column;
35 align-items: center;
36 .loading-container {
37 width: 100%;
38 height: 15%;
39 justify-self: end;
40 border-top: #414040 1px solid;
41 border-left: #414040 1px solid;
42 border-bottom: #414040 1px solid;
43 }
44 }
45 #tool-view {
46 width: 100%;
47 overflow-y: auto;
48 overflow-x: hidden;
49 height: 100%;
50 &::-webkit-scrollbar {
51 width: 12px;
52 }
53 &::-webkit-scrollbar-thumb {
54 background-color: #4c4c4c38;
55 }
56 &::-webkit-scrollbar-corner {
57 background-color: transparent;
58 }
59 }
60 </style>