From 621af884b5e766dedaad2109d42d91c5309f0dbd Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Sun, 27 Aug 2023 15:25:37 +0200 Subject: [PATCH] Centered modal --- frontend/src/app.svelte | 15 +++------------ frontend/src/components/modal.svelte | 9 ++------- frontend/src/lib/stores/environment.js | 5 +++++ 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/frontend/src/app.svelte b/frontend/src/app.svelte index 5ee0209..d57f521 100644 --- a/frontend/src/app.svelte +++ b/frontend/src/app.svelte @@ -3,7 +3,6 @@ import ContextMenu from '$components/contextmenu.svelte'; import dialogs from '$lib/dialogs.js'; import contextMenu from '$lib/stores/contextmenu.js'; - import environment from '$lib/stores/environment.js'; import hostTree from '$lib/stores/hosttree.js'; import applicationInited from '$lib/stores/inited.js'; import windowTitle from '$lib/stores/windowtitle.js'; @@ -43,7 +42,7 @@ -
+
{$windowTitle}
{#if $applicationInited && (showWelcomeScreen !== undefined)} @@ -74,7 +73,7 @@ align-items: center; overflow: hidden; } - #root.platform-darwin .titlebar { + :global([data-platform="darwin"]) .titlebar { height: var(--darwin-titlebar-height); } @@ -86,7 +85,7 @@ main.empty { grid-template: 1fr / 1fr; } - #root.platform-darwin main { + :global([data-platform="darwin"]) main { height: calc(100vh - var(--darwin-titlebar-height)); } @@ -98,12 +97,4 @@ main > :global(.addressbar) { grid-column: 1 / 3; } - - .databaselist { - overflow: scroll; - } - - .button.create { - margin-top: 0.5rem; - } diff --git a/frontend/src/components/modal.svelte b/frontend/src/components/modal.svelte index 6eb5edf..00d3377 100644 --- a/frontend/src/components/modal.svelte +++ b/frontend/src/components/modal.svelte @@ -73,19 +73,14 @@ height: 100vh; background-color: rgba(0, 0, 0, 0.5); margin: 0; - padding-top: 50px; + padding: 2rem; --wails-draggable: drag; } - :global(#root.platform-darwin) .outer { - margin-top: var(--darwin-titlebar-height); - } .inner { max-height: 80vh; background-color: #fff; - margin-left: auto; - margin-right: auto; - margin-bottom: auto; + margin: auto; width: 100%; border-radius: var(--radius); display: flex; diff --git a/frontend/src/lib/stores/environment.js b/frontend/src/lib/stores/environment.js index 8b78f1c..4b16874 100644 --- a/frontend/src/lib/stores/environment.js +++ b/frontend/src/lib/stores/environment.js @@ -11,5 +11,10 @@ async function reload() { reload(); +subscribe(env => { + // @ts-ignore + document.body.dataset.platform = env?.platform; +}); + const environment = { reload, subscribe }; export default environment;