main menu available in web version

This commit is contained in:
Jan Prochazka
2022-02-12 08:23:37 +01:00
parent 0c951b4659
commit db6d930d0c
8 changed files with 94 additions and 49 deletions

View File

@@ -24,22 +24,16 @@
import dragDropFileTarget from './utility/dragDropFileTarget';
import TitleBar from './widgets/TitleBar.svelte';
import { onMount } from 'svelte';
import getElectron from './utility/getElectron';
import { shouldDrawTitleBar } from './utility/common';
$: currentThemeType = $currentThemeDefinition?.themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light';
let domTabs;
let drawTitleBar = false;
onMount(async () => {
let draw = true;
const electron = getElectron();
if (electron && (await electron.isNativeMenu())) {
draw = false;
}
drawTitleBar = draw;
drawTitleBar = await shouldDrawTitleBar();
document.documentElement.style.setProperty('--dim-visible-titlebar', drawTitleBar ? 1 : 0);
console.log('drawTitleBar', drawTitleBar);
});
function handleTabsWheel(e) {
@@ -48,11 +42,13 @@
domTabs.scrollBy({ top: 0, left: e.deltaY < 0 ? -150 : 150, behavior: 'smooth' });
}
}
$: themeStyle = `<style id="themePlugin">${$currentThemeDefinition?.themeCss}</style>`;
</script>
<svelte:head>
{#if $currentThemeDefinition?.themeCss}
{@html `<style id="themePlugin">${$currentThemeDefinition?.themeCss}</style>`}
{@html themeStyle}
{/if}
</svelte:head>