mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 18:46:36 -05:00
Merge from vscode 0a7364f00514c46c9caceece15e1f82f82e3712f
This commit is contained in:
@@ -12,10 +12,13 @@ import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/bro
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { IViewlet } from 'vs/workbench/common/viewlet';
|
||||
import { IPanel } from 'vs/workbench/common/panel';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { Action2, MenuId, registerAction2, SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
|
||||
import { Direction } from 'vs/base/browser/ui/grid/grid';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
|
||||
abstract class BaseNavigationAction extends Action {
|
||||
|
||||
@@ -257,12 +260,38 @@ export class FocusPreviousPart extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions);
|
||||
class GoHomeContributor implements IWorkbenchContribution {
|
||||
|
||||
constructor(
|
||||
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService
|
||||
) {
|
||||
const homeIndicator = environmentService.options?.homeIndicator;
|
||||
if (homeIndicator) {
|
||||
registerAction2(class extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: `workbench.actions.goHome`,
|
||||
title: nls.localize('goHome', "Go Home"),
|
||||
menu: { id: MenuId.MenubarWebNavigationMenu }
|
||||
});
|
||||
}
|
||||
async run(): Promise<void> {
|
||||
window.location.href = homeIndicator.href;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const actionsRegistry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions);
|
||||
const viewCategory = nls.localize('view', "View");
|
||||
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateUpAction, undefined), 'View: Navigate to the View Above', viewCategory);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateDownAction, undefined), 'View: Navigate to the View Below', viewCategory);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateLeftAction, undefined), 'View: Navigate to the View on the Left', viewCategory);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateRightAction, undefined), 'View: Navigate to the View on the Right', viewCategory);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusNextPart, { primary: KeyCode.F6 }), 'View: Focus Next Part', viewCategory);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPreviousPart, { primary: KeyMod.Shift | KeyCode.F6 }), 'View: Focus Previous Part', viewCategory);
|
||||
actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateUpAction, undefined), 'View: Navigate to the View Above', viewCategory);
|
||||
actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateDownAction, undefined), 'View: Navigate to the View Below', viewCategory);
|
||||
actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateLeftAction, undefined), 'View: Navigate to the View on the Left', viewCategory);
|
||||
actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateRightAction, undefined), 'View: Navigate to the View on the Right', viewCategory);
|
||||
actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusNextPart, { primary: KeyCode.F6 }), 'View: Focus Next Part', viewCategory);
|
||||
actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPreviousPart, { primary: KeyMod.Shift | KeyCode.F6 }), 'View: Focus Previous Part', viewCategory);
|
||||
|
||||
const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
|
||||
workbenchRegistry.registerWorkbenchContribution(GoHomeContributor, LifecyclePhase.Ready);
|
||||
|
||||
@@ -256,7 +256,7 @@ export class BreadcrumbsControl {
|
||||
input = input.primary;
|
||||
}
|
||||
if (Registry.as<IEditorInputFactoryRegistry>(Extensions.EditorInputFactories).getFileEditorInputFactory().isFileEditorInput(input)) {
|
||||
fileInfoUri = input.label;
|
||||
fileInfoUri = input.preferredResource;
|
||||
}
|
||||
|
||||
this.domNode.classList.toggle('hidden', false);
|
||||
|
||||
@@ -32,7 +32,8 @@ import { Selection } from 'vs/editor/common/core/selection';
|
||||
import { TabFocus } from 'vs/editor/common/config/commonEditorConfig';
|
||||
import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ITextFileService, SUPPORTED_ENCODINGS } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { SUPPORTED_ENCODINGS } from 'vs/workbench/services/textfile/common/encoding';
|
||||
import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { ConfigurationChangedEvent, IEditorOptions, EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
|
||||
@@ -163,6 +163,8 @@
|
||||
|
||||
.monaco-workbench .part.panel > .composite.title> .panel-switcher-container > .monaco-action-bar .badge {
|
||||
margin-left: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.monaco-workbench .part.panel > .composite.title> .panel-switcher-container > .monaco-action-bar .badge .badge-content {
|
||||
@@ -170,13 +172,14 @@
|
||||
border-radius: 11px;
|
||||
font-size: 11px;
|
||||
min-width: 18px;
|
||||
min-height: 18px;
|
||||
height: 18px;
|
||||
line-height: 11px;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Rotate icons when panel is on right */
|
||||
.monaco-workbench .part.panel.right .title-actions .codicon-split-horizontal,
|
||||
|
||||
@@ -20,7 +20,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
export class TreeViewPane extends ViewPane {
|
||||
|
||||
private treeView: ITreeView;
|
||||
protected readonly treeView: ITreeView;
|
||||
|
||||
constructor(
|
||||
options: IViewletViewOptions,
|
||||
@@ -55,7 +55,7 @@ export class TreeViewPane extends ViewPane {
|
||||
|
||||
renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
this.treeView.show(container);
|
||||
this.renderTreeView(container);
|
||||
}
|
||||
|
||||
shouldShowWelcome(): boolean {
|
||||
@@ -64,13 +64,21 @@ export class TreeViewPane extends ViewPane {
|
||||
|
||||
layoutBody(height: number, width: number): void {
|
||||
super.layoutBody(height, width);
|
||||
this.treeView.layout(height, width);
|
||||
this.layoutTreeView(height, width);
|
||||
}
|
||||
|
||||
getOptimalWidth(): number {
|
||||
return this.treeView.getOptimalWidth();
|
||||
}
|
||||
|
||||
protected renderTreeView(container: HTMLElement): void {
|
||||
this.treeView.show(container);
|
||||
}
|
||||
|
||||
protected layoutTreeView(height: number, width: number): void {
|
||||
this.treeView.layout(height, width);
|
||||
}
|
||||
|
||||
private updateTreeVisibility(): void {
|
||||
this.treeView.setVisibility(this.isBodyVisible());
|
||||
}
|
||||
|
||||
@@ -982,6 +982,8 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
|
||||
this.updateViewHeaders();
|
||||
}
|
||||
});
|
||||
|
||||
this._register(this.viewContainerModel.onDidChangeActiveViewDescriptors(() => this._onTitleAreaUpdate.fire()));
|
||||
}
|
||||
|
||||
getTitle(): string {
|
||||
|
||||
@@ -45,7 +45,7 @@ export abstract class Viewlet extends PaneComposite implements IViewlet {
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
) {
|
||||
super(id, viewPaneContainer, telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService);
|
||||
this._register(Event.any(viewPaneContainer.onDidAddViews, viewPaneContainer.onDidRemoveViews)(() => {
|
||||
this._register(Event.any(viewPaneContainer.onDidAddViews, viewPaneContainer.onDidRemoveViews, viewPaneContainer.onTitleAreaUpdate)(() => {
|
||||
// Update title area since there is no better way to update secondary actions
|
||||
this.updateTitleArea();
|
||||
}));
|
||||
|
||||
@@ -22,7 +22,7 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio
|
||||
enum: ['default', 'large'],
|
||||
enumDescriptions: [
|
||||
nls.localize('workbench.editor.titleScrollbarSizing.default', "The default size."),
|
||||
nls.localize('workbench.editor.titleScrollbarSizing.large', "Increases the size, so it can be grabed more easily with the mouse")
|
||||
nls.localize('workbench.editor.titleScrollbarSizing.large', "Increases the size, so it can be grabbed more easily with the mouse")
|
||||
],
|
||||
description: nls.localize('tabScrollbarHeight', "Controls the height of the scrollbars used for tabs and breadcrumbs in the editor title area."),
|
||||
default: 'default',
|
||||
|
||||
Reference in New Issue
Block a user