Skip to content

Commit ecc64bd

Browse files
committed
Put close icons at the start of the tab label by default on macOS
Add a new window.tabCloseIconPlacement preference for whether to present the Close (X) icon in tab titles on the left or the right of the tab. Default to the left on macOS platform in conformity with the OS's native tab controls. Show the new preference in the Settings UI on macOS platform only. Render the tab title with the icon on the left or right accordingly. Fixes eclipse-theia/theia-ide#460 Signed-off-by: Christian W. Damus <[email protected]>
1 parent 3a714cb commit ecc64bd

File tree

3 files changed

+268
-123
lines changed

3 files changed

+268
-123
lines changed

packages/core/src/browser/core-preferences.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,18 @@ export const corePreferenceSchema: PreferenceSchema = {
121121
scope: 'application',
122122
markdownDescription: nls.localizeByDefault('Separator used by {0}.', '`#window.title#`')
123123
},
124+
'window.tabCloseIconPlacement': {
125+
type: 'string',
126+
enum: ['end', 'start'],
127+
enumDescriptions: [
128+
nls.localize('theia/core/window/tabCloseIconPlacement/end', 'Place the close icon at the end of the label. In left-to-right languages, this is the right side of the tab.'),
129+
nls.localize('theia/core/window/tabCloseIconPlacement/start', 'Place the close icon at the start of the label. In left-to-right languages, this is the left side of the tab.'),
130+
],
131+
default: isOSX ? 'start' : 'end',
132+
scope: 'application',
133+
description: nls.localize('theia/core/window/tabCloseIconPlacement/description', 'Place the close icons on tab titles at the start or end of the tab. The default is the host OS convention.'),
134+
included: isOSX
135+
},
124136
'window.secondaryWindowPlacement': {
125137
type: 'string',
126138
enum: ['originalSize', 'halfWidth', 'fullSize'],
@@ -305,6 +317,7 @@ export interface CoreConfiguration {
305317
'window.menuBarVisibility': 'classic' | 'visible' | 'hidden' | 'compact';
306318
'window.title': string;
307319
'window.titleSeparator': string;
320+
'window.tabCloseIconPlacement': 'end' | 'start';
308321
'workbench.list.openMode': 'singleClick' | 'doubleClick';
309322
'workbench.commandPalette.history': number;
310323
'workbench.editor.highlightModifiedTabs': boolean;

0 commit comments

Comments
 (0)