@codingame/monaco-vscode-view-status-bar-service-override 9.0.3 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.js +20 -20
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarActions.js +16 -18
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarItem.js +2 -3
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarModel.js +11 -12
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.js +14 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-view-status-bar-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
3
2
|
import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
3
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
5
|
-
import { isAccessibilityInformation } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
6
|
-
import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
7
4
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
-
import { asStatusBarItemIdentifier } from 'vscode/vscode/vs/workbench/api/common/extHostTypes';
|
|
9
|
-
import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
10
5
|
import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
11
6
|
import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
12
|
-
import {
|
|
7
|
+
import { isAccessibilityInformation } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
8
|
+
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
9
|
+
import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
10
|
+
import { asStatusBarItemIdentifier } from 'vscode/vscode/vs/workbench/api/common/extHostTypes';
|
|
11
|
+
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
12
|
+
import { IExtensionStatusBarItemService } from 'vscode/vscode/vs/workbench/api/browser/statusBarService';
|
|
13
13
|
|
|
14
14
|
function isUserFriendlyStatusItemEntry(candidate) {
|
|
15
15
|
const obj = candidate;
|
|
@@ -29,62 +29,62 @@ const statusBarItemSchema = {
|
|
|
29
29
|
id: {
|
|
30
30
|
type: 'string',
|
|
31
31
|
markdownDescription: ( localize(
|
|
32
|
-
|
|
32
|
+
3019,
|
|
33
33
|
'The identifier of the status bar entry. Must be unique within the extension. The same value must be used when calling the `vscode.window.createStatusBarItem(id, ...)`-API'
|
|
34
34
|
))
|
|
35
35
|
},
|
|
36
36
|
name: {
|
|
37
37
|
type: 'string',
|
|
38
38
|
description: ( localize(
|
|
39
|
-
|
|
39
|
+
3020,
|
|
40
40
|
'The name of the entry, like \'Python Language Indicator\', \'Git Status\' etc. Try to keep the length of the name short, yet descriptive enough that users can understand what the status bar item is about.'
|
|
41
41
|
))
|
|
42
42
|
},
|
|
43
43
|
text: {
|
|
44
44
|
type: 'string',
|
|
45
45
|
description: ( localize(
|
|
46
|
-
|
|
46
|
+
3021,
|
|
47
47
|
'The text to show for the entry. You can embed icons in the text by leveraging the `$(<name>)`-syntax, like \'Hello $(globe)!\''
|
|
48
48
|
))
|
|
49
49
|
},
|
|
50
50
|
tooltip: {
|
|
51
51
|
type: 'string',
|
|
52
|
-
description: ( localize(
|
|
52
|
+
description: ( localize(3022, 'The tooltip text for the entry.'))
|
|
53
53
|
},
|
|
54
54
|
command: {
|
|
55
55
|
type: 'string',
|
|
56
|
-
description: ( localize(
|
|
56
|
+
description: ( localize(3023, 'The command to execute when the status bar entry is clicked.'))
|
|
57
57
|
},
|
|
58
58
|
alignment: {
|
|
59
59
|
type: 'string',
|
|
60
60
|
enum: ['left', 'right'],
|
|
61
|
-
description: ( localize(
|
|
61
|
+
description: ( localize(3024, 'The alignment of the status bar entry.'))
|
|
62
62
|
},
|
|
63
63
|
priority: {
|
|
64
64
|
type: 'number',
|
|
65
65
|
description: ( localize(
|
|
66
|
-
|
|
66
|
+
3025,
|
|
67
67
|
'The priority of the status bar entry. Higher value means the item should be shown more to the left.'
|
|
68
68
|
))
|
|
69
69
|
},
|
|
70
70
|
accessibilityInformation: {
|
|
71
71
|
type: 'object',
|
|
72
72
|
description: ( localize(
|
|
73
|
-
|
|
73
|
+
3026,
|
|
74
74
|
'Defines the role and aria label to be used when the status bar entry is focused.'
|
|
75
75
|
)),
|
|
76
76
|
properties: {
|
|
77
77
|
role: {
|
|
78
78
|
type: 'string',
|
|
79
79
|
description: ( localize(
|
|
80
|
-
|
|
80
|
+
3027,
|
|
81
81
|
'The role of the status bar entry which defines how a screen reader interacts with it. More about aria roles can be found here https://w3c.github.io/aria/#widget_roles'
|
|
82
82
|
))
|
|
83
83
|
},
|
|
84
84
|
label: {
|
|
85
85
|
type: 'string',
|
|
86
86
|
description: ( localize(
|
|
87
|
-
|
|
87
|
+
3028,
|
|
88
88
|
'The aria label of the status bar entry. Defaults to the entry\'s text.'
|
|
89
89
|
))
|
|
90
90
|
}
|
|
@@ -93,7 +93,7 @@ const statusBarItemSchema = {
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
const statusBarItemsSchema = {
|
|
96
|
-
description: ( localize(
|
|
96
|
+
description: ( localize(3029, "Contributes items to the status bar.")),
|
|
97
97
|
oneOf: [
|
|
98
98
|
statusBarItemSchema,
|
|
99
99
|
{
|
|
@@ -119,12 +119,12 @@ let StatusBarItemsExtensionPoint = class StatusBarItemsExtensionPoint {
|
|
|
119
119
|
const { value, collector } = entry;
|
|
120
120
|
for (const candidate of Iterable.wrap(value)) {
|
|
121
121
|
if (!isUserFriendlyStatusItemEntry(candidate)) {
|
|
122
|
-
collector.error(( localize(
|
|
122
|
+
collector.error(( localize(3030, "Invalid status bar item contribution.")));
|
|
123
123
|
continue;
|
|
124
124
|
}
|
|
125
125
|
const fullItemId = asStatusBarItemIdentifier(entry.description.identifier, candidate.id);
|
|
126
126
|
const kind = statusBarItemsService.setOrUpdateEntry(fullItemId, fullItemId, ExtensionIdentifier.toKey(entry.description.identifier), candidate.name ?? entry.description.displayName ?? entry.description.name, candidate.text, candidate.tooltip, candidate.command ? { id: candidate.command, title: candidate.name } : undefined, undefined, undefined, candidate.alignment === 'left', candidate.priority, candidate.accessibilityInformation);
|
|
127
|
-
if (kind ===
|
|
127
|
+
if (kind === 0 ) {
|
|
128
128
|
contributions.add(toDisposable(() => statusBarItemsService.unsetEntry(fullItemId)));
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -145,6 +145,6 @@ let StatusBarItemsExtensionPointWorkbenchContribution = class StatusBarItemsExte
|
|
|
145
145
|
StatusBarItemsExtensionPointWorkbenchContribution = ( (__decorate([
|
|
146
146
|
( (__param(0, IInstantiationService)))
|
|
147
147
|
], StatusBarItemsExtensionPointWorkbenchContribution)));
|
|
148
|
-
registerWorkbenchContribution2(StatusBarItemsExtensionPointWorkbenchContribution.ID, StatusBarItemsExtensionPointWorkbenchContribution,
|
|
148
|
+
registerWorkbenchContribution2(StatusBarItemsExtensionPointWorkbenchContribution.ID, StatusBarItemsExtensionPointWorkbenchContribution, 1 );
|
|
149
149
|
|
|
150
150
|
export { StatusBarItemsExtensionPoint };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { localize, localize2 } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
3
3
|
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
4
|
-
import { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
5
4
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
6
|
-
import {
|
|
7
|
-
import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
5
|
+
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
8
6
|
import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
9
7
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
10
8
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
@@ -28,7 +26,7 @@ class ToggleStatusbarEntryVisibilityAction extends Action {
|
|
|
28
26
|
}
|
|
29
27
|
class HideStatusbarEntryAction extends Action {
|
|
30
28
|
constructor(id, name, model) {
|
|
31
|
-
super(id, ( localize(
|
|
29
|
+
super(id, ( localize(6781, "Hide '{0}'", name)), undefined, true);
|
|
32
30
|
this.model = model;
|
|
33
31
|
}
|
|
34
32
|
async run() {
|
|
@@ -37,9 +35,9 @@ class HideStatusbarEntryAction extends Action {
|
|
|
37
35
|
}
|
|
38
36
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
39
37
|
id: 'workbench.statusBar.focusPrevious',
|
|
40
|
-
weight:
|
|
41
|
-
primary:
|
|
42
|
-
secondary: [
|
|
38
|
+
weight: 200 ,
|
|
39
|
+
primary: 15 ,
|
|
40
|
+
secondary: [16 ],
|
|
43
41
|
when: StatusBarFocused,
|
|
44
42
|
handler: (accessor) => {
|
|
45
43
|
const statusBarService = accessor.get(IStatusbarService);
|
|
@@ -48,9 +46,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
48
46
|
});
|
|
49
47
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
50
48
|
id: 'workbench.statusBar.focusNext',
|
|
51
|
-
weight:
|
|
52
|
-
primary:
|
|
53
|
-
secondary: [
|
|
49
|
+
weight: 200 ,
|
|
50
|
+
primary: 17 ,
|
|
51
|
+
secondary: [18 ],
|
|
54
52
|
when: StatusBarFocused,
|
|
55
53
|
handler: (accessor) => {
|
|
56
54
|
const statusBarService = accessor.get(IStatusbarService);
|
|
@@ -59,8 +57,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
59
57
|
});
|
|
60
58
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
61
59
|
id: 'workbench.statusBar.focusFirst',
|
|
62
|
-
weight:
|
|
63
|
-
primary:
|
|
60
|
+
weight: 200 ,
|
|
61
|
+
primary: 14 ,
|
|
64
62
|
when: StatusBarFocused,
|
|
65
63
|
handler: (accessor) => {
|
|
66
64
|
const statusBarService = accessor.get(IStatusbarService);
|
|
@@ -70,8 +68,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
70
68
|
});
|
|
71
69
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
72
70
|
id: 'workbench.statusBar.focusLast',
|
|
73
|
-
weight:
|
|
74
|
-
primary:
|
|
71
|
+
weight: 200 ,
|
|
72
|
+
primary: 13 ,
|
|
75
73
|
when: StatusBarFocused,
|
|
76
74
|
handler: (accessor) => {
|
|
77
75
|
const statusBarService = accessor.get(IStatusbarService);
|
|
@@ -81,8 +79,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
81
79
|
});
|
|
82
80
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
83
81
|
id: 'workbench.statusBar.clearFocus',
|
|
84
|
-
weight:
|
|
85
|
-
primary:
|
|
82
|
+
weight: 200 ,
|
|
83
|
+
primary: 9 ,
|
|
86
84
|
when: StatusBarFocused,
|
|
87
85
|
handler: (accessor) => {
|
|
88
86
|
const statusBarService = accessor.get(IStatusbarService);
|
|
@@ -99,14 +97,14 @@ class FocusStatusBarAction extends Action2 {
|
|
|
99
97
|
constructor() {
|
|
100
98
|
super({
|
|
101
99
|
id: 'workbench.action.focusStatusBar',
|
|
102
|
-
title: ( localize2(
|
|
100
|
+
title: ( localize2(6782, 'Focus Status Bar')),
|
|
103
101
|
category: Categories.View,
|
|
104
102
|
f1: true
|
|
105
103
|
});
|
|
106
104
|
}
|
|
107
105
|
async run(accessor) {
|
|
108
106
|
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
109
|
-
layoutService.focusPart(
|
|
107
|
+
layoutService.focusPart("workbench.parts.statusbar" , getActiveWindow());
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
registerAction2(FocusStatusBarAction);
|
|
@@ -11,7 +11,6 @@ import { show, hide, addDisposableListener, EventType, EventHelper, append } fro
|
|
|
11
11
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
12
12
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
13
13
|
import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
|
|
14
|
-
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
15
14
|
import { renderIcon, renderLabelWithIcons } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
16
15
|
import { syncing, spinningLoading } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
17
16
|
import { isMarkdownString, markdownStringEqual } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
@@ -102,11 +101,11 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
102
101
|
this.commandTouchListener.value = addDisposableListener(this.labelContainer, EventType$1.Tap, () => this.executeCommand(command));
|
|
103
102
|
this.commandKeyboardListener.value = addDisposableListener(this.labelContainer, EventType.KEY_DOWN, e => {
|
|
104
103
|
const event = ( new StandardKeyboardEvent(e));
|
|
105
|
-
if (event.equals(
|
|
104
|
+
if (event.equals(10 ) || event.equals(3 )) {
|
|
106
105
|
EventHelper.stop(e);
|
|
107
106
|
this.executeCommand(command);
|
|
108
107
|
}
|
|
109
|
-
else if (event.equals(
|
|
108
|
+
else if (event.equals(9 ) || event.equals(15 ) || event.equals(17 )) {
|
|
110
109
|
EventHelper.stop(e);
|
|
111
110
|
this.hover?.hide();
|
|
112
111
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
-
import { isStatusbarEntryLocation
|
|
2
|
+
import { isStatusbarEntryLocation } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
3
3
|
import { isAncestorOfActiveElement, hide, show } from 'vscode/vscode/vs/base/browser/dom';
|
|
4
|
-
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
5
4
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
6
5
|
|
|
7
6
|
class StatusbarViewModel extends Disposable {
|
|
@@ -21,7 +20,7 @@ class StatusbarViewModel extends Disposable {
|
|
|
21
20
|
this.registerListeners();
|
|
22
21
|
}
|
|
23
22
|
restoreState() {
|
|
24
|
-
const hiddenRaw = this.storageService.get(StatusbarViewModel.HIDDEN_ENTRIES_KEY,
|
|
23
|
+
const hiddenRaw = this.storageService.get(StatusbarViewModel.HIDDEN_ENTRIES_KEY, 0 );
|
|
25
24
|
if (hiddenRaw) {
|
|
26
25
|
try {
|
|
27
26
|
this.hidden = ( new Set(JSON.parse(hiddenRaw)));
|
|
@@ -31,7 +30,7 @@ class StatusbarViewModel extends Disposable {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
registerListeners() {
|
|
34
|
-
this._register(this.storageService.onDidChangeValue(
|
|
33
|
+
this._register(this.storageService.onDidChangeValue(0 , StatusbarViewModel.HIDDEN_ENTRIES_KEY, this._register(( new DisposableStore())))(() => this.onDidStorageValueChange()));
|
|
35
34
|
}
|
|
36
35
|
onDidStorageValueChange() {
|
|
37
36
|
const currentlyHidden = ( new Set(this.hidden));
|
|
@@ -161,10 +160,10 @@ class StatusbarViewModel extends Disposable {
|
|
|
161
160
|
}
|
|
162
161
|
saveState() {
|
|
163
162
|
if (this.hidden.size > 0) {
|
|
164
|
-
this.storageService.store(StatusbarViewModel.HIDDEN_ENTRIES_KEY, JSON.stringify(Array.from(( this.hidden.values()))),
|
|
163
|
+
this.storageService.store(StatusbarViewModel.HIDDEN_ENTRIES_KEY, JSON.stringify(Array.from(( this.hidden.values()))), 0 , 0 );
|
|
165
164
|
}
|
|
166
165
|
else {
|
|
167
|
-
this.storageService.remove(StatusbarViewModel.HIDDEN_ENTRIES_KEY,
|
|
166
|
+
this.storageService.remove(StatusbarViewModel.HIDDEN_ENTRIES_KEY, 0 );
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
169
|
sort() {
|
|
@@ -204,10 +203,10 @@ class StatusbarViewModel extends Disposable {
|
|
|
204
203
|
}
|
|
205
204
|
return mapEntryWithNumberedPriorityToIndex.get(entryA) - mapEntryWithNumberedPriorityToIndex.get(entryB);
|
|
206
205
|
}
|
|
207
|
-
if (entryA.alignment ===
|
|
206
|
+
if (entryA.alignment === 0 ) {
|
|
208
207
|
return -1;
|
|
209
208
|
}
|
|
210
|
-
if (entryB.alignment ===
|
|
209
|
+
if (entryB.alignment === 0 ) {
|
|
211
210
|
return 1;
|
|
212
211
|
}
|
|
213
212
|
return 0;
|
|
@@ -219,11 +218,11 @@ class StatusbarViewModel extends Disposable {
|
|
|
219
218
|
const relativeEntriesMap = mapEntryWithRelativePriority.get(entry.id);
|
|
220
219
|
const relativeEntries = relativeEntriesMap ? Array.from(( relativeEntriesMap.values())) : undefined;
|
|
221
220
|
if (relativeEntries) {
|
|
222
|
-
sortedEntries.push(...relativeEntries.filter(entry => isStatusbarEntryLocation(entry.priority.primary) && entry.priority.primary.alignment ===
|
|
221
|
+
sortedEntries.push(...relativeEntries.filter(entry => isStatusbarEntryLocation(entry.priority.primary) && entry.priority.primary.alignment === 0 ));
|
|
223
222
|
}
|
|
224
223
|
sortedEntries.push(entry);
|
|
225
224
|
if (relativeEntries) {
|
|
226
|
-
sortedEntries.push(...relativeEntries.filter(entry => isStatusbarEntryLocation(entry.priority.primary) && entry.priority.primary.alignment ===
|
|
225
|
+
sortedEntries.push(...relativeEntries.filter(entry => isStatusbarEntryLocation(entry.priority.primary) && entry.priority.primary.alignment === 1 ));
|
|
227
226
|
}
|
|
228
227
|
mapEntryWithRelativePriority.delete(entry.id);
|
|
229
228
|
}
|
|
@@ -237,8 +236,8 @@ class StatusbarViewModel extends Disposable {
|
|
|
237
236
|
this._entries = sortedEntries;
|
|
238
237
|
}
|
|
239
238
|
markFirstLastVisibleEntry() {
|
|
240
|
-
this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(
|
|
241
|
-
this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(
|
|
239
|
+
this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(0 ));
|
|
240
|
+
this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(1 ));
|
|
242
241
|
}
|
|
243
242
|
doMarkFirstLastVisibleStatusbarItem(entries) {
|
|
244
243
|
let firstVisibleItem;
|
|
@@ -5,13 +5,12 @@ import { MutableDisposable, dispose, DisposableStore, disposeIfDisposable, toDis
|
|
|
5
5
|
import { Part, MultiWindowParts } from 'vscode/vscode/vs/workbench/browser/part';
|
|
6
6
|
import { Gesture, EventType as EventType$1 } from 'vscode/vscode/vs/base/browser/touch';
|
|
7
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
-
import { isStatusbarEntryPriority,
|
|
8
|
+
import { isStatusbarEntryPriority, isStatusbarEntryLocation } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
9
9
|
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
10
10
|
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
|
|
11
11
|
import { toAction, Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
12
12
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
13
13
|
import { STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_ITEM_COMPACT_HOVER_BACKGROUND, STATUS_BAR_BACKGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_ITEM_FOCUS_BORDER, STATUS_BAR_BORDER, STATUS_BAR_NO_FOLDER_BORDER, STATUS_BAR_FOCUS_BORDER } from 'vscode/vscode/vs/workbench/common/theme';
|
|
14
|
-
import { WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
15
14
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
16
15
|
import 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
17
16
|
import { contrastBorder, activeContrastBorder } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
|
|
@@ -26,9 +25,7 @@ import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
|
26
25
|
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
27
26
|
import { addDisposableListener, EventType, clearNode, EventHelper, getWindow, createStyleSheet } from 'vscode/vscode/vs/base/browser/dom';
|
|
28
27
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
29
|
-
import { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
30
28
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
31
|
-
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
32
29
|
import { equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
33
30
|
import { StandardMouseEvent } from 'vscode/vscode/vs/base/browser/mouseEvent';
|
|
34
31
|
import { ToggleStatusbarVisibilityAction } from 'vscode/vscode/vs/workbench/browser/actions/layoutActions';
|
|
@@ -160,7 +157,7 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
160
157
|
if (extraClasses) {
|
|
161
158
|
itemContainer.classList.add(...extraClasses);
|
|
162
159
|
}
|
|
163
|
-
if (alignment ===
|
|
160
|
+
if (alignment === 1 ) {
|
|
164
161
|
itemContainer.classList.add('right');
|
|
165
162
|
}
|
|
166
163
|
else {
|
|
@@ -245,20 +242,20 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
245
242
|
clearNode(leftItemsContainer);
|
|
246
243
|
clearNode(rightItemsContainer);
|
|
247
244
|
for (const entry of [
|
|
248
|
-
...this.viewModel.getEntries(
|
|
249
|
-
...this.viewModel.getEntries(
|
|
245
|
+
...this.viewModel.getEntries(0 ),
|
|
246
|
+
...this.viewModel.getEntries(1 ).reverse()
|
|
250
247
|
]) {
|
|
251
|
-
const target = entry.alignment ===
|
|
248
|
+
const target = entry.alignment === 0 ? leftItemsContainer : rightItemsContainer;
|
|
252
249
|
target.appendChild(entry.container);
|
|
253
250
|
}
|
|
254
251
|
this.updateCompactEntries();
|
|
255
252
|
}
|
|
256
253
|
appendStatusbarEntry(entry) {
|
|
257
254
|
const entries = this.viewModel.getEntries(entry.alignment);
|
|
258
|
-
if (entry.alignment ===
|
|
255
|
+
if (entry.alignment === 1 ) {
|
|
259
256
|
entries.reverse();
|
|
260
257
|
}
|
|
261
|
-
const target = assertIsDefined(entry.alignment ===
|
|
258
|
+
const target = assertIsDefined(entry.alignment === 0 ? this.leftItemsContainer : this.rightItemsContainer);
|
|
262
259
|
const index = entries.indexOf(entry);
|
|
263
260
|
if (index + 1 === entries.length) {
|
|
264
261
|
target.appendChild(entry.container);
|
|
@@ -302,7 +299,7 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
302
299
|
}
|
|
303
300
|
compactEntryGroup.set(entry.id, entry);
|
|
304
301
|
compactEntryGroup.set(location.id, location);
|
|
305
|
-
if (entry.priority.primary.alignment ===
|
|
302
|
+
if (entry.priority.primary.alignment === 0 ) {
|
|
306
303
|
location.container.classList.add('compact-left');
|
|
307
304
|
entry.container.classList.add('compact-right');
|
|
308
305
|
}
|
|
@@ -351,7 +348,7 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
351
348
|
}
|
|
352
349
|
getContextMenuActions(event) {
|
|
353
350
|
const actions = [];
|
|
354
|
-
actions.push(toAction({ id: ToggleStatusbarVisibilityAction.ID, label: ( localize(
|
|
351
|
+
actions.push(toAction({ id: ToggleStatusbarVisibilityAction.ID, label: ( localize(3018, "Hide Status Bar")), run: () => this.instantiationService.invokeFunction(accessor => ( (new ToggleStatusbarVisibilityAction())).run(accessor)) }));
|
|
355
352
|
actions.push(( (new Separator())));
|
|
356
353
|
const handledEntries = ( (new Set()));
|
|
357
354
|
for (const entry of this.viewModel.entries) {
|
|
@@ -378,12 +375,12 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
378
375
|
super.updateStyles();
|
|
379
376
|
const container = assertIsDefined(this.getContainer());
|
|
380
377
|
const styleOverride = [...this.styleOverrides].sort((a, b) => a.priority - b.priority)[0];
|
|
381
|
-
const backgroundColor = this.getColor(styleOverride?.background ?? (this.contextService.getWorkbenchState() !==
|
|
378
|
+
const backgroundColor = this.getColor(styleOverride?.background ?? (this.contextService.getWorkbenchState() !== 1 ? STATUS_BAR_BACKGROUND : STATUS_BAR_NO_FOLDER_BACKGROUND)) || '';
|
|
382
379
|
container.style.backgroundColor = backgroundColor;
|
|
383
|
-
const foregroundColor = this.getColor(styleOverride?.foreground ?? (this.contextService.getWorkbenchState() !==
|
|
380
|
+
const foregroundColor = this.getColor(styleOverride?.foreground ?? (this.contextService.getWorkbenchState() !== 1 ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND)) || '';
|
|
384
381
|
container.style.color = foregroundColor;
|
|
385
382
|
const itemBorderColor = this.getColor(STATUS_BAR_ITEM_FOCUS_BORDER);
|
|
386
|
-
const borderColor = this.getColor(styleOverride?.border ?? (this.contextService.getWorkbenchState() !==
|
|
383
|
+
const borderColor = this.getColor(styleOverride?.border ?? (this.contextService.getWorkbenchState() !== 1 ? STATUS_BAR_BORDER : STATUS_BAR_NO_FOLDER_BORDER)) || this.getColor(contrastBorder);
|
|
387
384
|
if (borderColor) {
|
|
388
385
|
container.classList.add('status-border-top');
|
|
389
386
|
container.style.setProperty('--status-border-top-color', borderColor);
|
|
@@ -429,7 +426,7 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
429
426
|
}
|
|
430
427
|
toJSON() {
|
|
431
428
|
return {
|
|
432
|
-
type:
|
|
429
|
+
type: "workbench.parts.statusbar"
|
|
433
430
|
};
|
|
434
431
|
}
|
|
435
432
|
dispose() {
|
|
@@ -448,7 +445,7 @@ StatusbarPart = StatusbarPart_1 = ( (__decorate([
|
|
|
448
445
|
], StatusbarPart)));
|
|
449
446
|
let MainStatusbarPart = class MainStatusbarPart extends StatusbarPart {
|
|
450
447
|
constructor(instantiationService, themeService, contextService, storageService, layoutService, contextMenuService, contextKeyService) {
|
|
451
|
-
super(
|
|
448
|
+
super("workbench.parts.statusbar" , instantiationService, themeService, contextService, storageService, layoutService, contextMenuService, contextKeyService);
|
|
452
449
|
}
|
|
453
450
|
};
|
|
454
451
|
MainStatusbarPart = ( (__decorate([
|