mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
change theme menu command
This commit is contained in:
parent
e2dcfe9940
commit
bc9e8a2ea6
@ -91,6 +91,7 @@ function buildMenu() {
|
|||||||
{ role: 'zoomout' },
|
{ role: 'zoomout' },
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{ role: 'togglefullscreen' },
|
{ role: 'togglefullscreen' },
|
||||||
|
commandItem('theme.changeTheme'),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { getCommands } from '../stores';
|
import { getCommands, visibleCommandPalette } from '../stores';
|
||||||
import { GlobalCommand } from './registerCommand';
|
import { GlobalCommand } from './registerCommand';
|
||||||
|
|
||||||
export default function runCommand(id) {
|
export default function runCommand(id) {
|
||||||
@ -11,6 +11,8 @@ export default function runCommand(id) {
|
|||||||
} else {
|
} else {
|
||||||
if (command.onClick) {
|
if (command.onClick) {
|
||||||
command.onClick();
|
command.onClick();
|
||||||
|
} else if (command.getSubCommands) {
|
||||||
|
visibleCommandPalette.set(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ registerCommand({
|
|||||||
id: 'theme.changeTheme',
|
id: 'theme.changeTheme',
|
||||||
category: 'Theme',
|
category: 'Theme',
|
||||||
name: 'Change',
|
name: 'Change',
|
||||||
|
toolbarName: 'Change theme',
|
||||||
getSubCommands: () => get(extensions).themes.map(themeCommand),
|
getSubCommands: () => get(extensions).themes.map(themeCommand),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user