mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
Add Cmd+, shortcut to open Settings
Handle Cmd+, (Ctrl+, on Linux/Windows) in the global keydown handler to toggle the Settings modal, matching the existing font-size and Escape shortcuts.
This commit is contained in:
+5
-1
@@ -18,7 +18,7 @@
|
||||
import { nodeRunning } from "@app/lib/events";
|
||||
import { dynamicInterval } from "@app/lib/interval";
|
||||
import { invoke } from "@app/lib/invoke";
|
||||
import { hide } from "@app/lib/modal";
|
||||
import { hide, toggle } from "@app/lib/modal";
|
||||
import * as router from "@app/lib/router";
|
||||
import { isLoadedRepoRoute } from "@app/lib/router/definitions";
|
||||
import {
|
||||
@@ -35,6 +35,7 @@
|
||||
theme,
|
||||
} from "@app/components/ThemeSwitch.svelte";
|
||||
import GuideView from "@app/modals/Guide.svelte";
|
||||
import SettingsView from "@app/modals/Settings.svelte";
|
||||
import Auth from "@app/views/auth/Auth.svelte";
|
||||
import CreateIdentity from "@app/views/auth/CreateIdentity.svelte";
|
||||
import InboxView from "@app/views/Inbox.svelte";
|
||||
@@ -176,6 +177,9 @@
|
||||
decreaseFontSize();
|
||||
} else if (auxiliarKey && e.key.toLowerCase() === "0") {
|
||||
resetFontSize();
|
||||
} else if (auxiliarKey && e.key === ",") {
|
||||
e.preventDefault();
|
||||
toggle({ component: SettingsView, props: {} });
|
||||
}
|
||||
}} />
|
||||
<FullscreenModalPortal />
|
||||
|
||||
@@ -73,6 +73,10 @@ export function show<T extends Component<any>>(args: ShowArgs<T>): void {
|
||||
export function toggle<T extends Component<any>>(args: ShowArgs<T>): void {
|
||||
const stored = get(modalStore);
|
||||
|
||||
if (stored?.disableHide) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (stored && stored.component === args.component) {
|
||||
hide();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user