diff --git a/dev.moku.app.yml b/dev.moku.app.yml index d27a957..8266021 100644 --- a/dev.moku.app.yml +++ b/dev.moku.app.yml @@ -181,7 +181,7 @@ modules: path: . - type: file path: packaging/frontend-dist.tar.gz - sha256: 9e9590cf8c98b07ca774382491b1d8cfcc1f2151afadbf8e23e2abda0c086c11 + sha256: e5b4e81c241bfd6940cea0f4815f36ce0f0260fae7249e90d56926b8cafe8016 - packaging/cargo-sources.json - type: inline dest: src-tauri/.cargo diff --git a/src/App.svelte b/src/App.svelte index 1422f7a..195c1f6 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -79,7 +79,7 @@ let platformScale = $state(1.0); function applyZoom() { - const uiZoom = store.settings.uiZoom ?? 1.5; + const uiZoom = store.settings.uiZoom ?? 1.0; const effective = platformScale * uiZoom; const pct = effective * 100; document.documentElement.style.zoom = `${pct}%`; @@ -282,6 +282,25 @@ } }); + function handleZoomKey(e: KeyboardEvent) { + if (!e.ctrlKey) return; + if (e.key === "=" || e.key === "+") { + e.preventDefault(); + store.settings.uiZoom = Math.min(2.0, Math.round(((store.settings.uiZoom ?? 1.0) + 0.1) * 10) / 10); + } else if (e.key === "-") { + e.preventDefault(); + store.settings.uiZoom = Math.max(0.5, Math.round(((store.settings.uiZoom ?? 1.0) - 0.1) * 10) / 10); + } else if (e.key === "0") { + e.preventDefault(); + store.settings.uiZoom = 1.0; + } + } + + $effect(() => { + window.addEventListener("keydown", handleZoomKey); + return () => window.removeEventListener("keydown", handleZoomKey); + }); + function handleRetry() { failed = false; notConfigured = false; diff --git a/src/components/layout/Sidebar.svelte b/src/components/layout/Sidebar.svelte index 95ef3ae..9ca0220 100644 --- a/src/components/layout/Sidebar.svelte +++ b/src/components/layout/Sidebar.svelte @@ -50,19 +50,20 @@