Add interface languages and improve themes and workspace controls for 0.1.36
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { tr } from '../i18n/index.ts';
|
||||
import type { editor } from "monaco-editor";
|
||||
import { actionMenu, type ActionMenuItem } from "../ui/actionMenu";
|
||||
|
||||
@@ -36,19 +37,19 @@ export function codeMenu(view: editor.IStandaloneCodeEditor, report: (message: s
|
||||
};
|
||||
const run = (id: string) => { close(); void view.getAction(id)?.run(); };
|
||||
const items: ActionMenuItem[] = [
|
||||
{ label: "Undo", icon: "undo", shortcut: "Ctrl+Z", disabled: !model.canUndo(), run: () => { close(); view.trigger("code-menu", "undo", null); } },
|
||||
{ label: "Redo", icon: "redo", shortcut: "Ctrl+Shift+Z", disabled: !model.canRedo(), run: () => { close(); view.trigger("code-menu", "redo", null); } },
|
||||
{ label: tr("Undo"), icon: "undo", shortcut: "Ctrl+Z", disabled: !model.canUndo(), run: () => { close(); view.trigger("code-menu", "undo", null); } },
|
||||
{ label: tr("Redo"), icon: "redo", shortcut: "Ctrl+Shift+Z", disabled: !model.canRedo(), run: () => { close(); view.trigger("code-menu", "redo", null); } },
|
||||
{ separator: true },
|
||||
{ label: "Change all occurrences", icon: "select", shortcut: "Ctrl+F2", disabled: !view.getAction("editor.action.changeAll")?.isSupported(), run: () => run("editor.action.changeAll") },
|
||||
{ label: tr("Change all occurrences"), icon: "select", shortcut: "Ctrl+F2", disabled: !view.getAction("editor.action.changeAll")?.isSupported(), run: () => run("editor.action.changeAll") },
|
||||
{ separator: true },
|
||||
{ label: "Cut", icon: "cut", shortcut: "Ctrl+X", disabled: !selected, run: () => void clipboard("cut") },
|
||||
{ label: "Copy", icon: "copy", shortcut: "Ctrl+C", disabled: !selected, run: () => void clipboard("copy") },
|
||||
{ label: "Paste", icon: "paste", shortcut: "Ctrl+V", run: () => void clipboard("paste") },
|
||||
{ label: "Select all", icon: "select", shortcut: "Ctrl+A", run: () => { close(); view.setSelection(model.getFullModelRange()); } },
|
||||
{ label: tr("Cut"), icon: "cut", shortcut: "Ctrl+X", disabled: !selected, run: () => void clipboard("cut") },
|
||||
{ label: tr("Copy"), icon: "copy", shortcut: "Ctrl+C", disabled: !selected, run: () => void clipboard("copy") },
|
||||
{ label: tr("Paste"), icon: "paste", shortcut: "Ctrl+V", run: () => void clipboard("paste") },
|
||||
{ label: tr("Select all"), icon: "select", shortcut: "Ctrl+A", run: () => { close(); view.setSelection(model.getFullModelRange()); } },
|
||||
{ separator: true },
|
||||
{ label: "Command palette", icon: "terminal", shortcut: "F1", run: () => run("editor.action.quickCommand") },
|
||||
{ label: tr("Command palette"), icon: "terminal", shortcut: "F1", run: () => run("editor.action.quickCommand") },
|
||||
];
|
||||
root = actionMenu(x, y, items, close, "Code text actions");
|
||||
root = actionMenu(x, y, items, close, tr("Code text actions"));
|
||||
}
|
||||
return { open, close, destroy() {
|
||||
close(false);
|
||||
|
||||
Reference in New Issue
Block a user