From bc9e8a2ea651ba89f6590dac0c417968e24f31bb Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 25 Mar 2021 13:38:06 +0100 Subject: [PATCH] change theme menu command --- app/src/electron.js | 1 + packages/web/src/commands/runCommand.ts | 4 +++- packages/web/src/commands/stdCommands.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/electron.js b/app/src/electron.js index 933383cd..bc985cb5 100644 --- a/app/src/electron.js +++ b/app/src/electron.js @@ -91,6 +91,7 @@ function buildMenu() { { role: 'zoomout' }, { type: 'separator' }, { role: 'togglefullscreen' }, + commandItem('theme.changeTheme'), ], }, { diff --git a/packages/web/src/commands/runCommand.ts b/packages/web/src/commands/runCommand.ts index 5212f12e..871f12ec 100644 --- a/packages/web/src/commands/runCommand.ts +++ b/packages/web/src/commands/runCommand.ts @@ -1,4 +1,4 @@ -import { getCommands } from '../stores'; +import { getCommands, visibleCommandPalette } from '../stores'; import { GlobalCommand } from './registerCommand'; export default function runCommand(id) { @@ -11,6 +11,8 @@ export default function runCommand(id) { } else { if (command.onClick) { command.onClick(); + } else if (command.getSubCommands) { + visibleCommandPalette.set(command); } } } diff --git a/packages/web/src/commands/stdCommands.ts b/packages/web/src/commands/stdCommands.ts index cf3678a4..369ffbcc 100644 --- a/packages/web/src/commands/stdCommands.ts +++ b/packages/web/src/commands/stdCommands.ts @@ -35,6 +35,7 @@ registerCommand({ id: 'theme.changeTheme', category: 'Theme', name: 'Change', + toolbarName: 'Change theme', getSubCommands: () => get(extensions).themes.map(themeCommand), });