提交 cc5dab4d 编写于 作者: S SteVen Batten

fixes #65092

fixes #64975
上级 8ac2c23f
......@@ -107,6 +107,12 @@ export class TitlebarPart extends Part implements ITitleService {
if (event.affectsConfiguration('window.title')) {
this.doUpdateTitle();
}
if (event.affectsConfiguration('window.doubleClickIconToClose')) {
if (this.appIcon) {
this.onUpdateAppIconDragBehavior();
}
}
}
private onMenubarVisibilityChanged(visible: boolean) {
......@@ -285,6 +291,11 @@ export class TitlebarPart extends Part implements ITitleService {
// App Icon (Windows/Linux)
if (!isMacintosh) {
this.appIcon = append(this.titleContainer, $('div.window-appicon'));
this.onUpdateAppIconDragBehavior();
this._register(addDisposableListener(this.appIcon, EventType.DBLCLICK, (e => {
this.windowService.closeWindow();
})));
}
// Menubar: the menubar part which is responsible for populating both the custom and native menubars
......@@ -444,6 +455,16 @@ export class TitlebarPart extends Part implements ITitleService {
this.windowService.onWindowTitleDoubleClick();
}
private onUpdateAppIconDragBehavior() {
const setting = this.configurationService.getValue('window.doubleClickIconToClose');
if (setting) {
this.appIcon.style['-webkit-app-region'] = 'no-drag';
}
else {
this.appIcon.style['-webkit-app-region'] = 'drag';
}
}
private onContextMenu(e: MouseEvent): void {
// Find target anchor
......
......@@ -806,6 +806,12 @@ configurationRegistry.registerConfiguration({
'description': nls.localize('autoDetectHighContrast', "If enabled, will automatically change to high contrast theme if Windows is using a high contrast theme, and to dark theme when switching away from a Windows high contrast theme."),
'included': isWindows
},
'window.doubleClickIconToClose': {
'type': 'boolean',
'default': false,
'scope': ConfigurationScope.APPLICATION,
'description': nls.localize('window.doubleClickIconToClose', "If enabled, double clicking the application icon in the title bar will close the window and the window cannot be dragged by the icon. This setting only has an effect when 'window.titleBarStyle' is set to 'custom'.")
},
'window.titleBarStyle': {
'type': 'string',
'enum': ['native', 'custom'],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册