mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-28 07:40:30 -04:00
Merge from vscode 1b314ab317fbff7d799b21754326b7d849889ceb
This commit is contained in:
@@ -8,9 +8,9 @@ import 'vs/css!./media/actions';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import { applyZoom } from 'vs/platform/windows/electron-sandbox/window';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { webFrame } from 'vs/base/parts/sandbox/electron-sandbox/globals';
|
||||
import { getZoomLevel } from 'vs/base/browser/browser';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
@@ -62,18 +62,9 @@ export abstract class BaseZoomAction extends Action {
|
||||
return; // https://github.com/microsoft/vscode/issues/48357
|
||||
}
|
||||
|
||||
const applyZoom = () => {
|
||||
webFrame.setZoomLevel(level);
|
||||
browser.setZoomFactor(webFrame.getZoomFactor());
|
||||
// See https://github.com/Microsoft/vscode/issues/26151
|
||||
// Cannot be trusted because the webFrame might take some time
|
||||
// until it really applies the new zoom level
|
||||
browser.setZoomLevel(webFrame.getZoomLevel(), /*isTrusted*/false);
|
||||
};
|
||||
|
||||
await this.configurationService.updateValue(BaseZoomAction.SETTING_KEY, level);
|
||||
|
||||
applyZoom();
|
||||
applyZoom(level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +82,7 @@ export class ZoomInAction extends BaseZoomAction {
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
this.setConfiguredZoomLevel(webFrame.getZoomLevel() + 1);
|
||||
this.setConfiguredZoomLevel(getZoomLevel() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +100,7 @@ export class ZoomOutAction extends BaseZoomAction {
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
this.setConfiguredZoomLevel(webFrame.getZoomLevel() - 1);
|
||||
this.setConfiguredZoomLevel(getZoomLevel() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import { getZoomFactor } from 'vs/base/browser/browser';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -209,14 +209,14 @@ export class TitlebarPart extends BrowserTitleBarPart {
|
||||
if (getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') {
|
||||
// Only prevent zooming behavior on macOS or when the menubar is not visible
|
||||
if (isMacintosh || this.currentMenubarVisibility === 'hidden') {
|
||||
this.title.style.zoom = `${1 / browser.getZoomFactor()}`;
|
||||
this.title.style.zoom = `${1 / getZoomFactor()}`;
|
||||
if (isWindows || isLinux) {
|
||||
if (this.appIcon) {
|
||||
this.appIcon.style.zoom = `${1 / browser.getZoomFactor()}`;
|
||||
this.appIcon.style.zoom = `${1 / getZoomFactor()}`;
|
||||
}
|
||||
|
||||
if (this.windowControls) {
|
||||
this.windowControls.style.zoom = `${1 / browser.getZoomFactor()}`;
|
||||
this.windowControls.style.zoom = `${1 / getZoomFactor()}`;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user