diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index e25a3fc..21da4eb 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -12,6 +12,8 @@ "core:window:allow-close", "core:window:allow-is-maximized", "core:window:allow-set-decorations", + "core:window:allow-is-fullscreen", + "core:window:allow-set-fullscreen", "core:window:allow-set-title", "core:webview:allow-create-webview-window", "dialog:default", diff --git a/src/lib/components/AppLayout.svelte b/src/lib/components/AppLayout.svelte index a2580fe..34210c9 100644 --- a/src/lib/components/AppLayout.svelte +++ b/src/lib/components/AppLayout.svelte @@ -41,7 +41,7 @@ const appWindow = getCurrentWindow(); const isMac = navigator.platform.startsWith('Mac'); const isMobile = /android|ios/i.test(navigator.userAgent); - import { loadVaultState, saveVaultState, readNote, createDailyNote, createBackup, getPendingOpenFile, addQuickAccess, removeQuickAccess, getQuickAccess } from '$lib/api'; + import { loadVaultState, saveVaultState, readNote, createDailyNote, createBackup, getPendingOpenFile, addQuickAccess, removeQuickAccess, getQuickAccess, setTheme } from '$lib/api'; import { debounce } from '$lib/utils/debounce'; import { openNoteWindow } from '$lib/utils/window'; import { get } from 'svelte/store'; @@ -268,6 +268,11 @@ } if (mod && e.shiftKey && e.key === 'N') { e.preventDefault(); + const isDark = $theme === 'dark' || ($theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); + const next = isDark ? 'light' : 'dark'; + $theme = next; + setTheme(next); + return; } if (mod && e.shiftKey && e.key === 'F') { e.preventDefault(); @@ -305,6 +310,26 @@ openNoteWindow($activeNotePath, $activeNote.meta.title); } } + if (mod && e.key === '\\') { + e.preventDefault(); + $sidebarCollapsed = !$sidebarCollapsed; + return; + } + if (mod && e.shiftKey && e.key === 'E') { + e.preventDefault(); + $focusMode = !$focusMode; + return; + } + if (mod && e.shiftKey && e.key === 'R') { + e.preventDefault(); + $readOnly = !$readOnly; + return; + } + if (e.key === 'F11') { + e.preventDefault(); + appWindow.isFullscreen().then(fs => appWindow.setFullscreen(!fs)); + return; + } if (e.key === 'Escape') { if ($showSettings) $showSettings = false; else if ($showInfo) $showInfo = false; diff --git a/src/lib/components/InfoPanel.svelte b/src/lib/components/InfoPanel.svelte index 903a050..24a3afd 100644 --- a/src/lib/components/InfoPanel.svelte +++ b/src/lib/components/InfoPanel.svelte @@ -116,22 +116,37 @@ {:else}