configurable native menu

This commit is contained in:
Jan Prochazka
2022-02-12 10:01:40 +01:00
parent f11d3e134b
commit a1f5d1f230
8 changed files with 57 additions and 29 deletions

View File

@@ -24,18 +24,12 @@
import dragDropFileTarget from './utility/dragDropFileTarget';
import TitleBar from './widgets/TitleBar.svelte';
import { onMount } from 'svelte';
import { shouldDrawTitleBar } from './utility/common';
import { getTitleBarVisibility } from './utility/common';
$: currentThemeType = $currentThemeDefinition?.themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light';
let domTabs;
let drawTitleBar = false;
onMount(async () => {
drawTitleBar = await shouldDrawTitleBar();
document.documentElement.style.setProperty('--dim-visible-titlebar', drawTitleBar ? 1 : 0);
});
function handleTabsWheel(e) {
if (!e.shiftKey) {
e.preventDefault();
@@ -57,7 +51,7 @@
use:dragDropFileTarget
on:contextmenu={e => e.preventDefault()}
>
{#if drawTitleBar}
{#if getTitleBarVisibility()}
<div class="titlebar">
<TitleBar />
</div>