adjust modals for title bar (#5648)

This commit is contained in:
Anthony Dresser
2019-05-27 14:40:16 -07:00
committed by GitHub
parent 3e8f25d864
commit b4cce9f147
22 changed files with 45 additions and 50 deletions

View File

@@ -22,9 +22,9 @@ import { localize } from 'vs/nls';
import { MessageLevel } from 'sql/workbench/api/common/sqlExtHostTypes';
import * as os from 'os';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { isUndefinedOrNull } from 'vs/base/common/types';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export const MODAL_SHOWING_KEY = 'modalShowing';
export const MODAL_SHOWING_CONTEXT = new RawContextKey<Array<string>>(MODAL_SHOWING_KEY, []);
@@ -143,7 +143,7 @@ export abstract class Modal extends Disposable implements IThemable {
private _title: string,
private _name: string,
private _telemetryService: ITelemetryService,
protected layoutService: ILayoutService,
protected layoutService: IWorkbenchLayoutService,
protected _clipboardService: IClipboardService,
protected _themeService: IThemeService,
protected logService: ILogService,
@@ -172,6 +172,8 @@ export abstract class Modal extends Disposable implements IThemable {
}
this._bodyContainer = DOM.$(`.${builderClass}`, { role: 'dialog', 'aria-label': this._title });
const top = this.layoutService.getTitleBarOffset();
this._bodyContainer.style.top = `${top}px`;
this._modalDialog = DOM.append(this._bodyContainer, DOM.$('.modal-dialog', { role: 'document' }));
const modalContent = DOM.append(this._modalDialog, DOM.$('.modal-content'));

View File

@@ -30,9 +30,9 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { append, $ } from 'vs/base/browser/dom';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class CategoryView extends ViewletPanel {
@@ -87,7 +87,7 @@ export class OptionsDialog extends Modal {
title: string,
name: string,
options: IOptionsDialogOptions,
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IContextViewService private _contextViewService: IContextViewService,
@IInstantiationService private _instantiationService: IInstantiationService,

View File

@@ -18,7 +18,7 @@ import { bootstrapAngular } from 'sql/platform/bootstrap/node/bootstrapService';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { append, $ } from 'vs/base/browser/dom';
import { ILogService } from 'vs/platform/log/common/log';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class BackupDialog extends Modal {
private _body: HTMLElement;
@@ -27,7 +27,7 @@ export class BackupDialog extends Modal {
constructor(
@IThemeService themeService: IThemeService,
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IInstantiationService private _instantiationService: IInstantiationService,

View File

@@ -23,7 +23,7 @@ export class AdvancedPropertiesController {
this._options = this._advancedDialog.optionValues;
}
public showDialog(providerOptions: azdata.ConnectionOption[], container: HTMLElement, options: { [name: string]: any }): void {
public showDialog(providerOptions: azdata.ConnectionOption[], options: { [name: string]: any }): void {
this._options = options;
let serviceOptions = providerOptions.map(option => AdvancedPropertiesController.connectionOptionToServiceOption(option));
this.advancedDialog.open(serviceOptions, this._options);

View File

@@ -16,7 +16,6 @@ import { Event, Emitter } from 'vs/base/common/event';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { localize } from 'vs/nls';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Button } from 'sql/base/browser/ui/button/button';
@@ -27,6 +26,7 @@ import { attachButtonStyler, attachModalDialogStyler } from 'sql/platform/theme/
import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class ServerGroupDialog extends Modal {
private _addServerButton: Button;
@@ -49,7 +49,7 @@ export class ServerGroupDialog extends Modal {
public onCloseEvent: Event<void> = this._onCloseEvent.event;
constructor(
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IContextViewService private _contextViewService: IContextViewService,
@ITelemetryService telemetryService: ITelemetryService,

View File

@@ -24,8 +24,8 @@ import { Event, Emitter } from 'vs/base/common/event';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
class EventItem {
@@ -310,7 +310,7 @@ export class ProfilerColumnEditorDialog extends Modal {
private _treeContainer: HTMLElement;
constructor(
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,

View File

@@ -24,7 +24,7 @@ import * as DOM from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { ProfilerFilter, ProfilerFilterClause, ProfilerFilterClauseOperator } from 'sql/workbench/services/profiler/common/interfaces';
import { ILogService } from 'vs/platform/log/common/log';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
const ClearText: string = localize('profilerFilterDialog.clear', "Clear All");
@@ -71,7 +71,7 @@ export class ProfilerFilterDialog extends Modal {
constructor(
@IThemeService themeService: IThemeService,
@IClipboardService clipboardService: IClipboardService,
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@ILogService logService: ILogService,

View File

@@ -17,7 +17,6 @@ import { localize } from 'vs/nls';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { mixin } from 'vs/base/common/objects';
import * as strings from 'vs/base/common/strings';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import * as DOM from 'vs/base/browser/dom';
import * as azdata from 'azdata';
@@ -43,6 +42,7 @@ import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { IFileBrowserDialogController } from 'sql/workbench/services/fileBrowser/common/fileBrowserDialogController';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
interface FileListElement {
logicalFileName: string;
@@ -129,7 +129,7 @@ export class RestoreDialog extends Modal {
constructor(
optionsMetadata: azdata.ServiceOption[],
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IContextViewService private _contextViewService: IContextViewService,
@ITelemetryService telemetryService: ITelemetryService,

View File

@@ -17,9 +17,8 @@ import { localize } from 'vs/nls';
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import * as DOM from 'vs/base/browser/dom';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { ILogService } from 'vs/platform/log/common/log';
export class WebViewDialog extends Modal {
@@ -42,7 +41,7 @@ export class WebViewDialog extends Modal {
constructor(
@IThemeService themeService: IThemeService,
@IClipboardService clipboardService: IClipboardService,
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@ILogService logService: ILogService,

View File

@@ -15,14 +15,14 @@ import { CmsConnectionWidget } from 'sql/workbench/services/connection/browser/c
*/
export class CmsConnectionController extends ConnectionController {
constructor(container: HTMLElement,
constructor(
connectionManagementService: IConnectionManagementService,
connectionProperties: ConnectionProviderProperties,
callback: IConnectionComponentCallbacks,
providerName: string,
authTypeChanged: boolean = false,
@IInstantiationService _instantiationService: IInstantiationService) {
super(container, connectionManagementService, connectionProperties, callback, providerName, _instantiationService);
super(connectionManagementService, connectionProperties, callback, providerName, _instantiationService);
let specialOptions = this._providerOptions.filter(
(property) => (property.specialValueType !== null && property.specialValueType !== undefined));
this._connectionWidget = this._instantiationService.createInstance(CmsConnectionWidget, specialOptions, {

View File

@@ -17,7 +17,6 @@ import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/com
import { ConnectionWidget } from 'sql/workbench/services/connection/browser/connectionWidget';
export class ConnectionController implements IConnectionComponentController {
private _container: HTMLElement;
private _connectionManagementService: IConnectionManagementService;
private _advancedController: AdvancedPropertiesController;
private _model: IConnectionProfile;
@@ -28,13 +27,12 @@ export class ConnectionController implements IConnectionComponentController {
/* key: uri, value : list of databases */
protected _databaseCache = new Map<string, string[]>();
constructor(container: HTMLElement,
constructor(
connectionManagementService: IConnectionManagementService,
connectionProperties: ConnectionProviderProperties,
callback: IConnectionComponentCallbacks,
providerName: string,
@IInstantiationService protected _instantiationService: IInstantiationService) {
this._container = container;
this._connectionManagementService = connectionManagementService;
this._callback = callback;
this._providerOptions = connectionProperties.connectionOptions;
@@ -111,7 +109,7 @@ export class ConnectionController implements IConnectionComponentController {
}
let advancedOption = this._providerOptions.filter(
(property) => (property.specialValueType === undefined || property.specialValueType === null));
this._advancedController.showDialog(advancedOption, this._container, this._model.options);
this._advancedController.showDialog(advancedOption, this._model.options);
}
public showUiComponent(container: HTMLElement): void {

View File

@@ -60,7 +60,6 @@ export class ConnectionDialogService implements IConnectionDialogService {
_serviceBrand: any;
private _container: HTMLElement;
private _connectionDialog: ConnectionDialogWidget;
private _connectionControllerMap: { [providerDisplayName: string]: IConnectionComponentController } = {};
private _model: ConnectionProfile;
@@ -281,14 +280,14 @@ export class ConnectionDialogService implements IConnectionDialogService {
if (providerName === Constants.cmsProviderName) {
this._connectionControllerMap[providerName] =
this._instantiationService.createInstance(CmsConnectionController,
this._container, this._connectionManagementService,
this._connectionManagementService,
this._capabilitiesService.getCapabilities(providerName).connection, {
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
}, providerName, this._inputModel ? this._inputModel.options.authTypeChanged : false);
} else {
this._connectionControllerMap[providerName] =
this._instantiationService.createInstance(ConnectionController,
this._container, this._connectionManagementService,
this._connectionManagementService,
this._capabilitiesService.getCapabilities(providerName).connection, {
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
}, providerName);
@@ -420,8 +419,6 @@ export class ConnectionDialogService implements IConnectionDialogService {
private doShowDialog(params: INewConnectionParams): Promise<void> {
if (!this._connectionDialog) {
let container = this.layoutService.getWorkbenchElement().parentElement;
this._container = container;
this._connectionDialog = this._instantiationService.createInstance(ConnectionDialogWidget, this._providerTypes, this._providerNameToDisplayNameMap[this._model.providerName], this._providerNameToDisplayNameMap);
this._connectionDialog.onCancel(() => {
this._connectionDialog.databaseDropdownExpanded = this.uiController.databaseDropdownExpanded;

View File

@@ -35,8 +35,8 @@ import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export interface OnShowUIResponse {
selectedProviderType: string;
@@ -91,13 +91,13 @@ export class ConnectionDialogWidget extends Modal {
@IInstantiationService private _instantiationService: IInstantiationService,
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
@IThemeService themeService: IThemeService,
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IContextMenuService private _contextMenuService: IContextMenuService,
@IContextViewService private _contextViewService: IContextViewService,
@IClipboardService clipboardService: IClipboardService,
@ILayoutService logService: ILogService
@ILogService logService: ILogService
) {
super(localize('connection', "Connection"), TelemetryKeys.Connection, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, { hasSpinner: true, hasErrors: true });
}

View File

@@ -25,8 +25,8 @@ import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
import { NewDashboardTabViewModel, IDashboardUITab } from 'sql/workbench/services/dashboard/common/newDashboardTabViewModel';
import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
class ExtensionListDelegate implements IListVirtualDelegate<IDashboardUITab> {
@@ -107,7 +107,7 @@ export class NewDashboardTabDialog extends Modal {
public get onCancel(): Event<void> { return this._onCancel.event; }
constructor(
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,

View File

@@ -20,8 +20,8 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
import { localize } from 'vs/nls';
import { IAction } from 'vs/base/common/actions';
import * as DOM from 'vs/base/browser/dom';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
const maxActions = 1;
@@ -44,7 +44,7 @@ export class ErrorMessageDialog extends Modal {
constructor(
@IThemeService themeService: IThemeService,
@IClipboardService clipboardService: IClipboardService,
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@ILogService logService: ILogService

View File

@@ -24,14 +24,13 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { attachInputBoxStyler, attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import * as DOM from 'vs/base/browser/dom';
import * as strings from 'vs/base/common/strings';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class FileBrowserDialog extends Modal {
private _viewModel: FileBrowserViewModel;
@@ -49,7 +48,7 @@ export class FileBrowserDialog extends Modal {
private _isFolderSelected: boolean;
constructor(title: string,
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IContextViewService private _contextViewService: IContextViewService,

View File

@@ -40,7 +40,7 @@ import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/v
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ILogService } from 'vs/platform/log/common/log';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
const labelDisplay = nls.localize("insights.item", "Item");
const valueDisplay = nls.localize("insights.value", "Value");
@@ -158,7 +158,7 @@ export class InsightsDialogView extends Modal {
private _model: IInsightsDialogModel,
@IThemeService themeService: IThemeService,
@IClipboardService clipboardService: IClipboardService,
@ILayoutService layoutService: ILayoutService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@ILogService logService: ILogService,