dbgate/packages/web/src/Screen.svelte

124 lines
3.0 KiB
Svelte
Raw Normal View History

2021-02-28 08:27:57 +00:00
<script>
2021-02-17 19:08:16 +00:00
import WidgetContainer from './widgets/WidgetContainer.svelte';
2021-02-17 17:46:27 +00:00
import WidgetIconPanel from './widgets/WidgetIconPanel.svelte';
2021-02-28 08:27:57 +00:00
import { currentTheme, leftPanelWidth, selectedWidget, visibleCommandPalette, visibleToolbar } from './stores';
2021-02-21 10:35:50 +00:00
import TabsPanel from './widgets/TabsPanel.svelte';
2021-02-25 17:05:44 +00:00
import TabContent from './TabContent.svelte';
import CommandPalette from './commands/CommandPalette.svelte';
2021-02-26 18:25:35 +00:00
import Toolbar from './widgets/Toolbar.svelte';
2021-02-28 08:27:57 +00:00
import splitterDrag from './utility/splitterDrag';
2021-02-28 09:37:07 +00:00
import CurrentDropDownMenu from './modals/CurrentDropDownMenu.svelte';
2021-03-01 20:09:03 +00:00
import StatusBar from './widgets/StatusBar.svelte';
2021-02-17 17:46:27 +00:00
</script>
2021-02-25 18:30:20 +00:00
<div class={`${$currentTheme} root`}>
2021-02-17 17:46:27 +00:00
<div class="iconbar">
<WidgetIconPanel />
</div>
2021-03-01 20:09:03 +00:00
<div class="statusbar">
<StatusBar />
</div>
2021-02-17 19:08:16 +00:00
{#if $selectedWidget}
2021-02-20 09:43:43 +00:00
<div class="leftpanel">
2021-02-17 19:08:16 +00:00
<WidgetContainer />
</div>
{/if}
2021-02-21 10:35:50 +00:00
<div class="tabs">
<TabsPanel />
</div>
2021-02-22 16:34:24 +00:00
<div class="content">
<TabContent />
</div>
2021-02-28 08:28:47 +00:00
{#if $selectedWidget}
<div
class="horizontal-split-handle splitter"
use:splitterDrag={'clientX'}
on:resizeSplitter={e => leftPanelWidth.update(x => x + e.detail)}
/>
{/if}
2021-02-25 17:05:44 +00:00
{#if $visibleCommandPalette}
<div class="commads">
<CommandPalette />
</div>
{/if}
2021-02-26 18:25:35 +00:00
{#if $visibleToolbar}
<div class="toolbar">
<Toolbar />
</div>
{/if}
2021-02-28 09:17:52 +00:00
<CurrentDropDownMenu />
2021-02-17 17:46:27 +00:00
</div>
<style>
2021-02-25 18:30:20 +00:00
.root {
color: var(--theme-font-1);
}
2021-02-17 17:46:27 +00:00
.iconbar {
position: fixed;
left: 0;
2021-02-26 18:25:35 +00:00
top: var(--dim-header-top);
2021-02-20 09:40:29 +00:00
bottom: var(--dim-statusbar-height);
width: var(--dim-widget-icon-size);
background: var(--theme-bg-inv-1);
2021-02-17 17:46:27 +00:00
}
.statusbar {
position: fixed;
2021-02-20 09:40:29 +00:00
background: var(--theme-bg-statusbar-inv);
height: var(--dim-statusbar-height);
2021-02-17 17:46:27 +00:00
left: 0;
right: 0;
bottom: 0;
}
2021-02-17 19:08:16 +00:00
.leftpanel {
position: fixed;
2021-02-26 18:25:35 +00:00
top: var(--dim-header-top);
2021-02-20 09:40:29 +00:00
left: var(--dim-widget-icon-size);
bottom: var(--dim-statusbar-height);
2021-02-20 09:43:43 +00:00
width: var(--dim-left-panel-width);
2021-02-25 18:30:20 +00:00
background-color: var(--theme-bg-1);
2021-02-17 19:08:16 +00:00
display: flex;
}
2021-02-21 10:35:50 +00:00
.tabs {
display: flex;
position: fixed;
2021-02-26 18:25:35 +00:00
top: var(--dim-header-top);
2021-02-22 16:34:24 +00:00
left: var(--dim-content-left);
2021-02-21 10:35:50 +00:00
height: var(--dim-tabs-panel-height);
right: 0;
background-color: var(--theme-bg-2);
border-top: 1px solid var(--theme-border);
overflow-x: auto;
}
.tabs::-webkit-scrollbar {
height: 7px;
}
2021-02-22 16:34:24 +00:00
.content {
position: fixed;
2021-02-26 18:25:35 +00:00
top: var(--dim-content-top);
2021-02-22 16:34:24 +00:00
left: var(--dim-content-left);
bottom: var(--dim-statusbar-height);
right: 0;
background-color: var(--theme-bg-1);
}
2021-02-25 17:05:44 +00:00
.commads {
position: fixed;
2021-02-26 18:25:35 +00:00
top: var(--dim-header-top);
2021-02-25 17:05:44 +00:00
left: var(--dim-widget-icon-size);
}
2021-02-26 18:25:35 +00:00
.toolbar {
position: fixed;
top: 0;
height: var(--dim-toolbar-height);
left: 0;
right: 0;
}
2021-02-28 08:27:57 +00:00
.splitter {
position: absolute;
top: var(--dim-header-top);
bottom: var(--dim-statusbar-height);
left: calc(var(--dim-widget-icon-size) + var(--dim-left-panel-width));
}
2021-02-17 17:46:27 +00:00
</style>