From a5bc66eb270b430f432401f8e189c6a718cfd9a2 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sun, 21 Nov 2021 12:13:35 +0100 Subject: [PATCH] #186 zoom --- packages/web/src/settings/SettingsModal.svelte | 17 ++++++++++++++++- packages/web/src/stores.ts | 8 ++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/web/src/settings/SettingsModal.svelte b/packages/web/src/settings/SettingsModal.svelte index 73838145..dc0a2a69 100644 --- a/packages/web/src/settings/SettingsModal.svelte +++ b/packages/web/src/settings/SettingsModal.svelte @@ -5,13 +5,14 @@ import FormCheckboxField from '../forms/FormCheckboxField.svelte'; import FormProvider from '../forms/FormProvider.svelte'; + import FormSelectField from '../forms/FormSelectField.svelte'; import FormSubmit from '../forms/FormSubmit.svelte'; import FormTextField from '../forms/FormTextField.svelte'; import FormValues from '../forms/FormValues.svelte'; import ModalBase from '../modals/ModalBase.svelte'; import { closeCurrentModal } from '../modals/modalTools'; - import { getCurrentSettings, getVisibleToolbar, visibleToolbar } from '../stores'; + import { getCurrentSettings, getVisibleToolbar, getZoomKoef, visibleToolbar, zoomKoef } from '../stores'; import axiosInstance from '../utility/axiosInstance'; function handleOk(e) { @@ -20,6 +21,7 @@ _.omitBy(e.detail, (v, k) => k.startsWith(':')) ); visibleToolbar.set(!!e.detail[':visibleToolbar']); + zoomKoef.set(e.detail[':zoomKoef']); closeCurrentModal(); } @@ -28,6 +30,7 @@ initialValues={{ ...getCurrentSettings(), ':visibleToolbar': getVisibleToolbar(), + ':zoomKoef': getZoomKoef(), }} > @@ -36,6 +39,18 @@
Appearance
+
Data grid
diff --git a/packages/web/src/stores.ts b/packages/web/src/stores.ts index 2a8e7b94..524508d5 100644 --- a/packages/web/src/stores.ts +++ b/packages/web/src/stores.ts @@ -53,6 +53,7 @@ export const commandsCustomized = derived([commands, commandsSettings], ([$comma ); export const visibleToolbar = writableWithStorage(true, 'visibleToolbar'); +export const zoomKoef = writableWithStorage(1, 'zoomKoef'); export const leftPanelWidth = writable(300); export const currentDropDownMenu = writable(null); export const openedModals = writable([]); @@ -97,6 +98,13 @@ visibleToolbar.subscribe(value => { }); export const getVisibleToolbar = () => visibleToolbarValue; +let zommKoefValue = null; +zoomKoef.subscribe(value => { + zommKoefValue = value; + document.body.style.setProperty('zoom', zommKoefValue); +}); +export const getZoomKoef = () => zommKoefValue; + let openedTabsValue = null; openedTabs.subscribe(value => { openedTabsValue = value;