Skip to content

Commit 166efcb

Browse files
kylecarbscode-asher
authored andcommitted
Hide titlebar controls and fix menubar toggle (coder#550)
1 parent 206e107 commit 166efcb

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

packages/vscode/src/vscode.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@
5353
width: 56px !important;
5454
margin-right: 4px;
5555
}
56+
57+
.window-controls-container {
58+
display: none !important;
59+
}

scripts/vscode.patch

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -398,19 +398,35 @@ index 7b6ad89..3190356 100644
398398
- return;
399399
+ return (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.handleDrop(event, resolveTargetGroup, afterDrop, targetIndex);
400400
diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts
401-
index c25c940..9f11d98 100644
401+
index c25c940..f2004f8 100644
402402
--- a/src/vs/workbench/browser/layout.ts
403403
+++ b/src/vs/workbench/browser/layout.ts
404404
@@ -12 +12 @@ import { Registry } from 'vs/platform/registry/common/platform';
405405
-import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
406-
+import { isWindows, isLinux, isMacintosh, isNative, isWeb } from 'vs/base/common/platform';
406+
+import { isWindows, isLinux, isMacintosh, isNative } from 'vs/base/common/platform';
407407
@@ -210 +210 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
408408
- if ((isWindows || isLinux) && getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') {
409-
+ if ((isWeb || isWindows || isLinux) && getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') {
410-
@@ -535 +535 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
409+
+ // if ((isWeb || isWindows || isLinux) && getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') {
410+
@@ -212 +212 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
411+
- }
412+
+ // }
413+
@@ -219 +219 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
414+
- if (this.state.fullscreen && (this.state.menuBar.visibility === 'toggle' || this.state.menuBar.visibility === 'default')) {
415+
+ if ((this.state.menuBar.visibility === 'toggle' || this.state.menuBar.visibility === 'default')) {
416+
@@ -531 +531,5 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
417+
- if (getTitleBarStyle(this.configurationService, this.environmentService) === 'native') {
418+
+ if (this.state.menuBar.visibility === 'hidden') {
419+
+ return false;
420+
+ } else if (this.state.menuBar.visibility === 'toggle') {
421+
+ return this.state.menuBar.toggled;
422+
+ } else if (getTitleBarStyle(this.configurationService, this.environmentService) === 'native') {
423+
@@ -535 +539 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
411424
- } else if (isMacintosh) {
412425
+ } else if (isNative && isMacintosh) {
413-
@@ -567 +567 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
426+
@@ -539,2 +542,0 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
427+
- } else if (this.state.menuBar.visibility === 'toggle' || this.state.menuBar.visibility === 'default') {
428+
- return this.state.menuBar.toggled;
429+
@@ -567 +569 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
414430
- if (isMacintosh || this.state.menuBar.visibility === 'hidden') {
415431
+ if ((isNative && isMacintosh) || this.state.menuBar.visibility === 'hidden') {
416432
diff --git a/src/vs/workbench/browser/legacyLayout.ts b/src/vs/workbench/browser/legacyLayout.ts
@@ -522,7 +538,7 @@ index a822341..43b882a 100644
522538
- if (!isMacintosh && this.currentTitlebarStyleSetting === 'custom') {
523539
+ if (!(isNative && isMacintosh) && this.currentTitlebarStyleSetting === 'custom') {
524540
diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
525-
index 028f375..4bfe956 100644
541+
index 028f375..f740471 100644
526542
--- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
527543
+++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
528544
@@ -11 +11 @@ import { ITitleService, ITitleProperties } from 'vs/workbench/services/title/com
@@ -536,7 +552,10 @@ index 028f375..4bfe956 100644
536552
+ if (!(isNative && isMacintosh)) {
537553
@@ -343 +343 @@ export class TitlebarPart extends Part implements ITitleService {
538554
- if (!isMacintosh) {
539-
+ if (!(isNative && isMacintosh)) {
555+
+ // if (!(isNative && isMacintosh)) {
556+
@@ -346 +346 @@ export class TitlebarPart extends Part implements ITitleService {
557+
- }
558+
+ // }
540559
@@ -549 +549 @@ export class TitlebarPart extends Part implements ITitleService {
541560
- if (!isMacintosh &&
542561
+ if (!(isNative && isMacintosh) &&
@@ -888,7 +907,7 @@ index 48ef482..dc47f81 100644
888907
- placeHolder: isMacintosh ? nls.localize('openRecentPlaceHolderMac', "Select to open (hold Cmd-key to open in new window)") : nls.localize('openRecentPlaceHolder', "Select to open (hold Ctrl-key to open in new window)"),
889908
+ placeHolder: browser.isMacintosh ? nls.localize('openRecentPlaceHolderMac', "Select to open (hold Cmd-key to open in new window)") : nls.localize('openRecentPlaceHolder', "Select to open (hold Ctrl-key to open in new window)"),
890909
diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts
891-
index 71bc992..2692f39 100644
910+
index 71bc992..a76dad4 100644
892911
--- a/src/vs/workbench/electron-browser/main.contribution.ts
893912
+++ b/src/vs/workbench/electron-browser/main.contribution.ts
894913
@@ -13 +13,2 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
@@ -916,8 +935,10 @@ index 71bc992..2692f39 100644
916935
@@ -633 +634 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
917936
- 'included': isWindows || isLinux
918937
+ 'included': isWeb || isWindows || isLinux
919-
@@ -650 +651 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
938+
@@ -649,2 +650,2 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
939+
- 'enum': ['native', 'custom'],
920940
- 'default': isLinux ? 'native' : 'custom',
941+
+ 'enum': ['custom'],
921942
+ 'default': isNative && isLinux ? 'native' : 'custom',
922943
@@ -659 +660 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
923944
- 'included': isMacintosh && parseFloat(os.release()) >= 16 // Minimum: macOS Sierra (10.12.x = darwin 16.x)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy