mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
parent
3124b9a5cc
commit
8cad47446f
|
@ -106,6 +106,20 @@ class UntitledTextEditorHintContentWidget implements IContentWidget {
|
|||
if (!this.domNode) {
|
||||
this.domNode = $('.untitled-hint');
|
||||
this.domNode.style.width = 'max-content';
|
||||
|
||||
const editorType = $('a.editor-type');
|
||||
editorType.style.cursor = 'pointer';
|
||||
editorType.innerText = localize('notLookingForTextEditor', "Not looking for a text editor?");
|
||||
const selectEditorTypeKeyBinding = this.keybindingService.lookupKeybinding('welcome.showNewFileEntries');
|
||||
const selectEditorTypeKeybindingLabel = selectEditorTypeKeyBinding?.getLabel();
|
||||
if (selectEditorTypeKeybindingLabel) {
|
||||
editorType.title = localize('keyboardBindingTooltip', "{0}", selectEditorTypeKeybindingLabel);
|
||||
}
|
||||
this.domNode.appendChild(editorType);
|
||||
|
||||
this.domNode.appendChild($('br'));
|
||||
this.domNode.appendChild($('br'));
|
||||
|
||||
const language = $('a.language-mode');
|
||||
language.style.cursor = 'pointer';
|
||||
language.innerText = localize('selectAlanguage2', "Select a language");
|
||||
|
@ -116,20 +130,6 @@ class UntitledTextEditorHintContentWidget implements IContentWidget {
|
|||
}
|
||||
this.domNode.appendChild(language);
|
||||
|
||||
const or = $('span');
|
||||
or.innerText = localize('or', " or ",);
|
||||
this.domNode.appendChild(or);
|
||||
|
||||
const chooseEditor = $('a.choose-editor');
|
||||
chooseEditor.style.cursor = 'pointer';
|
||||
chooseEditor.innerText = localize('chooseEditor', "select a different editor");
|
||||
const chooseEditorKeyBinding = this.keybindingService.lookupKeybinding('welcome.showNewFileEntries');
|
||||
const chooseEditorKeybindingLabel = chooseEditorKeyBinding?.getLabel();
|
||||
if (chooseEditorKeybindingLabel) {
|
||||
chooseEditor.title = localize('chooseEditorBindingTooltip', "{0}", chooseEditorKeybindingLabel);
|
||||
}
|
||||
this.domNode.appendChild(chooseEditor);
|
||||
|
||||
const toGetStarted = $('span');
|
||||
toGetStarted.innerText = localize('toGetStarted', " to get started. Start typing to dismiss, or ",);
|
||||
this.domNode.appendChild(toGetStarted);
|
||||
|
@ -165,9 +165,9 @@ class UntitledTextEditorHintContentWidget implements IContentWidget {
|
|||
this.editorGroupsService.activeGroup.closeEditor(activeEditorInput, { preserveFocus: true });
|
||||
}
|
||||
};
|
||||
this.toDispose.push(dom.addDisposableListener(chooseEditor, 'click', chooseEditorOnClickOrTap));
|
||||
this.toDispose.push(dom.addDisposableListener(chooseEditor, GestureEventType.Tap, chooseEditorOnClickOrTap));
|
||||
this.toDispose.push(Gesture.addTarget(chooseEditor));
|
||||
this.toDispose.push(dom.addDisposableListener(editorType, 'click', chooseEditorOnClickOrTap));
|
||||
this.toDispose.push(dom.addDisposableListener(editorType, GestureEventType.Tap, chooseEditorOnClickOrTap));
|
||||
this.toDispose.push(Gesture.addTarget(editorType));
|
||||
|
||||
const dontShowOnClickOrTap = () => {
|
||||
this.configurationService.updateValue(untitledTextEditorHintSetting, 'hidden');
|
||||
|
|
|
@ -891,7 +891,7 @@ registerAction2(class extends Action2 {
|
|||
constructor() {
|
||||
super({
|
||||
id: 'workbench.files.action.createFileFromExplorer',
|
||||
title: nls.localize('createNewEditor', "New Editor"),
|
||||
title: nls.localize('createNewFile', "New File"),
|
||||
f1: false,
|
||||
icon: Codicon.newFile,
|
||||
precondition: ExplorerResourceNotReadonlyContext,
|
||||
|
|
|
@ -57,8 +57,8 @@ type GettingStartedStartEntryContent = BuiltinGettingStartedStartEntry[];
|
|||
export const startEntries: GettingStartedStartEntryContent = [
|
||||
{
|
||||
id: 'welcome.showNewFileEntries',
|
||||
title: localize('gettingStarted.newEditor.title', "New Editor..."),
|
||||
description: localize('gettingStarted.newEditor.description', "Open a new untitled file, notebook, or custom editor."),
|
||||
title: localize('gettingStarted.newFile.title', "New File..."),
|
||||
description: localize('gettingStarted.newFile.description', "Open a new untitled file, notebook, or custom editor."),
|
||||
icon: Codicon.newFile,
|
||||
content: {
|
||||
type: 'startEntry',
|
||||
|
|
|
@ -25,7 +25,7 @@ registerAction2(class extends Action2 {
|
|||
constructor() {
|
||||
super({
|
||||
id: 'welcome.showNewFileEntries',
|
||||
title: { value: localize('welcome.newEditor', "New Editor..."), original: 'New Editor...' },
|
||||
title: { value: localize('welcome.newFile', "New File..."), original: 'New File...' },
|
||||
category,
|
||||
f1: true,
|
||||
keybinding: {
|
||||
|
|
|
@ -242,7 +242,7 @@ const apiMenus: IAPIMenu[] = [
|
|||
{
|
||||
key: 'file/newFile',
|
||||
id: MenuId.NewFile,
|
||||
description: localize('file.newEditor', "The 'New Editor...' quick pick, shown on welcome page and File menu."),
|
||||
description: localize('file.newFile', "The 'New File...' quick pick, shown on welcome page and File menu."),
|
||||
supportsSubmenus: false,
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue