@theia/messages 1.47.1 → 1.48.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/README.md +30 -30
- package/lib/browser/messages-frontend-module.d.ts +4 -4
- package/lib/browser/messages-frontend-module.js +41 -41
- package/lib/browser/notification-center-component.d.ts +18 -18
- package/lib/browser/notification-center-component.js +67 -67
- package/lib/browser/notification-component.d.ts +15 -15
- package/lib/browser/notification-component.js +88 -88
- package/lib/browser/notification-content-renderer.d.ts +5 -5
- package/lib/browser/notification-content-renderer.js +35 -35
- package/lib/browser/notification-content-renderer.spec.d.ts +1 -1
- package/lib/browser/notification-content-renderer.spec.js +41 -41
- package/lib/browser/notification-preferences.d.ts +11 -11
- package/lib/browser/notification-preferences.js +46 -46
- package/lib/browser/notification-toasts-component.d.ts +18 -18
- package/lib/browser/notification-toasts-component.js +48 -48
- package/lib/browser/notifications-commands.d.ts +7 -7
- package/lib/browser/notifications-commands.js +47 -47
- package/lib/browser/notifications-contribution.d.ts +21 -21
- package/lib/browser/notifications-contribution.js +203 -203
- package/lib/browser/notifications-manager.d.ts +71 -71
- package/lib/browser/notifications-manager.js +274 -274
- package/lib/browser/notifications-renderer.d.ts +13 -13
- package/lib/browser/notifications-renderer.js +67 -67
- package/package.json +4 -4
- package/src/browser/messages-frontend-module.ts +42 -42
- package/src/browser/notification-center-component.tsx +95 -95
- package/src/browser/notification-component.tsx +128 -128
- package/src/browser/notification-content-renderer.spec.ts +73 -73
- package/src/browser/notification-content-renderer.ts +31 -31
- package/src/browser/notification-preferences.ts +58 -58
- package/src/browser/notification-toasts-component.tsx +67 -67
- package/src/browser/notifications-commands.ts +50 -50
- package/src/browser/notifications-contribution.ts +218 -218
- package/src/browser/notifications-manager.ts +305 -305
- package/src/browser/notifications-renderer.tsx +61 -61
- package/src/browser/style/index.css +17 -17
- package/src/browser/style/notifications.css +283 -283
|
@@ -1,218 +1,218 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2019 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
-
import {
|
|
19
|
-
FrontendApplicationContribution, StatusBar, FrontendApplication, StatusBarAlignment,
|
|
20
|
-
KeybindingContribution, KeybindingRegistry, StylingParticipant, ColorTheme, CssStyleCollector
|
|
21
|
-
} from '@theia/core/lib/browser';
|
|
22
|
-
import { NotificationsCommands } from './notifications-commands';
|
|
23
|
-
import { CommandContribution, CommandRegistry } from '@theia/core';
|
|
24
|
-
import { NotificationManager } from './notifications-manager';
|
|
25
|
-
import { NotificationsRenderer } from './notifications-renderer';
|
|
26
|
-
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
|
|
27
|
-
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
|
28
|
-
import { Color } from '@theia/core/lib/common/color';
|
|
29
|
-
import { nls } from '@theia/core/lib/common/nls';
|
|
30
|
-
import { isHighContrast } from '@theia/core/lib/common/theme';
|
|
31
|
-
|
|
32
|
-
@injectable()
|
|
33
|
-
export class NotificationsContribution implements FrontendApplicationContribution, CommandContribution, KeybindingContribution, ColorContribution, StylingParticipant {
|
|
34
|
-
|
|
35
|
-
protected readonly id = 'theia-notification-center';
|
|
36
|
-
|
|
37
|
-
@inject(NotificationManager)
|
|
38
|
-
protected readonly manager: NotificationManager;
|
|
39
|
-
|
|
40
|
-
@inject(NotificationsRenderer)
|
|
41
|
-
protected readonly notificationsRenderer: NotificationsRenderer; // required for initialization
|
|
42
|
-
|
|
43
|
-
@inject(StatusBar)
|
|
44
|
-
protected readonly statusBar: StatusBar;
|
|
45
|
-
|
|
46
|
-
onStart(_app: FrontendApplication): void {
|
|
47
|
-
this.createStatusBarItem();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
protected createStatusBarItem(): void {
|
|
51
|
-
this.updateStatusBarItem();
|
|
52
|
-
this.manager.onUpdated(e => this.updateStatusBarItem(e.notifications.length));
|
|
53
|
-
}
|
|
54
|
-
protected updateStatusBarItem(count: number = 0): void {
|
|
55
|
-
this.statusBar.setElement(this.id, {
|
|
56
|
-
text: this.getStatusBarItemText(count),
|
|
57
|
-
alignment: StatusBarAlignment.RIGHT,
|
|
58
|
-
priority: -900,
|
|
59
|
-
command: NotificationsCommands.TOGGLE.id,
|
|
60
|
-
tooltip: this.getStatusBarItemTooltip(count),
|
|
61
|
-
accessibilityInformation: {
|
|
62
|
-
label: this.getStatusBarItemTooltip(count)
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
protected getStatusBarItemText(count: number): string {
|
|
67
|
-
return `$(${count ? 'codicon-bell-dot' : 'codicon-bell'}) ${count ? ` ${count}` : ''}`;
|
|
68
|
-
}
|
|
69
|
-
protected getStatusBarItemTooltip(count: number): string {
|
|
70
|
-
if (this.manager.centerVisible) {
|
|
71
|
-
return nls.localizeByDefault('Hide Notifications');
|
|
72
|
-
}
|
|
73
|
-
return count === 0
|
|
74
|
-
? nls.localizeByDefault('No Notifications')
|
|
75
|
-
: count === 1
|
|
76
|
-
? nls.localizeByDefault('1 New Notification')
|
|
77
|
-
: nls.localizeByDefault('{0} New Notifications', count.toString());
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
registerCommands(commands: CommandRegistry): void {
|
|
81
|
-
commands.registerCommand(NotificationsCommands.TOGGLE, {
|
|
82
|
-
isEnabled: () => true,
|
|
83
|
-
execute: () => this.manager.toggleCenter()
|
|
84
|
-
});
|
|
85
|
-
commands.registerCommand(NotificationsCommands.SHOW, {
|
|
86
|
-
isEnabled: () => true,
|
|
87
|
-
execute: () => this.manager.showCenter()
|
|
88
|
-
});
|
|
89
|
-
commands.registerCommand(NotificationsCommands.HIDE, {
|
|
90
|
-
execute: () => this.manager.hide()
|
|
91
|
-
});
|
|
92
|
-
commands.registerCommand(NotificationsCommands.CLEAR_ALL, {
|
|
93
|
-
execute: () => this.manager.clearAll()
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
registerKeybindings(keybindings: KeybindingRegistry): void {
|
|
98
|
-
keybindings.registerKeybinding({
|
|
99
|
-
command: NotificationsCommands.HIDE.id,
|
|
100
|
-
when: 'notificationsVisible',
|
|
101
|
-
keybinding: 'esc'
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
registerColors(colors: ColorRegistry): void {
|
|
106
|
-
colors.register(
|
|
107
|
-
{
|
|
108
|
-
id: 'notificationCenter.border', defaults: {
|
|
109
|
-
hcDark: 'contrastBorder',
|
|
110
|
-
hcLight: 'contrastBorder'
|
|
111
|
-
}, description: 'Notifications center border color. Notifications slide in from the bottom right of the window.'
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
id: 'notificationToast.border', defaults: {
|
|
115
|
-
hcDark: 'contrastBorder',
|
|
116
|
-
hcLight: 'contrastBorder'
|
|
117
|
-
}, description: 'Notification toast border color. Notifications slide in from the bottom right of the window.'
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: 'notifications.foreground', defaults: {
|
|
121
|
-
dark: 'editorWidget.foreground',
|
|
122
|
-
light: 'editorWidget.foreground',
|
|
123
|
-
hcDark: 'editorWidget.foreground',
|
|
124
|
-
hcLight: 'editorWidget.foreground'
|
|
125
|
-
}, description: 'Notifications foreground color. Notifications slide in from the bottom right of the window.'
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
id: 'notifications.background', defaults: {
|
|
129
|
-
dark: 'editorWidget.background',
|
|
130
|
-
light: 'editorWidget.background',
|
|
131
|
-
hcDark: 'editorWidget.background',
|
|
132
|
-
hcLight: 'editorWidget.background'
|
|
133
|
-
}, description: 'Notifications background color. Notifications slide in from the bottom right of the window.'
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: 'notificationLink.foreground', defaults: {
|
|
137
|
-
dark: 'textLink.foreground',
|
|
138
|
-
light: 'textLink.foreground',
|
|
139
|
-
hcDark: 'textLink.foreground',
|
|
140
|
-
hcLight: 'textLink.foreground'
|
|
141
|
-
}, description: 'Notification links foreground color. Notifications slide in from the bottom right of the window.'
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 'notificationCenterHeader.foreground',
|
|
145
|
-
description: 'Notifications center header foreground color. Notifications slide in from the bottom right of the window.'
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
id: 'notificationCenterHeader.background', defaults: {
|
|
149
|
-
dark: Color.lighten('notifications.background', 0.3),
|
|
150
|
-
light: Color.darken('notifications.background', 0.05),
|
|
151
|
-
hcDark: 'notifications.background',
|
|
152
|
-
hcLight: 'notifications.background'
|
|
153
|
-
}, description: 'Notifications center header background color. Notifications slide in from the bottom right of the window.'
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: 'notifications.border', defaults: {
|
|
157
|
-
dark: 'notificationCenterHeader.background',
|
|
158
|
-
light: 'notificationCenterHeader.background',
|
|
159
|
-
hcDark: 'notificationCenterHeader.background',
|
|
160
|
-
hcLight: 'notificationCenterHeader.background'
|
|
161
|
-
// eslint-disable-next-line max-len
|
|
162
|
-
}, description: 'Notifications border color separating from other notifications in the notifications center. Notifications slide in from the bottom right of the window.'
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
id: 'notificationsErrorIcon.foreground', defaults: {
|
|
166
|
-
dark: 'editorError.foreground',
|
|
167
|
-
light: 'editorError.foreground',
|
|
168
|
-
hcDark: 'editorError.foreground',
|
|
169
|
-
hcLight: 'editorError.foreground'
|
|
170
|
-
}, description: 'The color used for the icon of error notifications. Notifications slide in from the bottom right of the window.'
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
id: 'notificationsWarningIcon.foreground', defaults: {
|
|
174
|
-
dark: 'editorWarning.foreground',
|
|
175
|
-
light: 'editorWarning.foreground',
|
|
176
|
-
hcDark: 'editorWarning.foreground',
|
|
177
|
-
hcLight: 'editorWarning.foreground'
|
|
178
|
-
}, description: 'The color used for the icon of warning notifications. Notifications slide in from the bottom right of the window.'
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
id: 'notificationsInfoIcon.foreground', defaults: {
|
|
182
|
-
dark: 'editorInfo.foreground',
|
|
183
|
-
light: 'editorInfo.foreground',
|
|
184
|
-
hcDark: 'editorInfo.foreground',
|
|
185
|
-
hcLight: 'editorInfo.foreground'
|
|
186
|
-
}, description: 'The color used for the icon of info notifications. Notifications slide in from the bottom right of the window.'
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
registerThemeStyle(theme: ColorTheme, collector: CssStyleCollector): void {
|
|
192
|
-
const notificationsBackground = theme.getColor('notifications.background');
|
|
193
|
-
if (notificationsBackground) {
|
|
194
|
-
collector.addRule(`
|
|
195
|
-
.theia-notification-list-item-container {
|
|
196
|
-
background-color: ${notificationsBackground};
|
|
197
|
-
}
|
|
198
|
-
`);
|
|
199
|
-
}
|
|
200
|
-
const notificationHover = theme.getColor('list.hoverBackground');
|
|
201
|
-
if (notificationHover) {
|
|
202
|
-
collector.addRule(`
|
|
203
|
-
.theia-notification-list-item:hover:not(:focus) {
|
|
204
|
-
background-color: ${notificationHover};
|
|
205
|
-
}
|
|
206
|
-
`);
|
|
207
|
-
}
|
|
208
|
-
const focusBorder = theme.getColor('focusBorder');
|
|
209
|
-
if (focusBorder && isHighContrast(theme.type)) {
|
|
210
|
-
collector.addRule(`
|
|
211
|
-
.theia-notification-list-item:hover:not(:focus) {
|
|
212
|
-
outline: 1px dashed ${focusBorder};
|
|
213
|
-
outline-offset: -2px;
|
|
214
|
-
}
|
|
215
|
-
`);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2019 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import {
|
|
19
|
+
FrontendApplicationContribution, StatusBar, FrontendApplication, StatusBarAlignment,
|
|
20
|
+
KeybindingContribution, KeybindingRegistry, StylingParticipant, ColorTheme, CssStyleCollector
|
|
21
|
+
} from '@theia/core/lib/browser';
|
|
22
|
+
import { NotificationsCommands } from './notifications-commands';
|
|
23
|
+
import { CommandContribution, CommandRegistry } from '@theia/core';
|
|
24
|
+
import { NotificationManager } from './notifications-manager';
|
|
25
|
+
import { NotificationsRenderer } from './notifications-renderer';
|
|
26
|
+
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
|
|
27
|
+
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
|
28
|
+
import { Color } from '@theia/core/lib/common/color';
|
|
29
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
30
|
+
import { isHighContrast } from '@theia/core/lib/common/theme';
|
|
31
|
+
|
|
32
|
+
@injectable()
|
|
33
|
+
export class NotificationsContribution implements FrontendApplicationContribution, CommandContribution, KeybindingContribution, ColorContribution, StylingParticipant {
|
|
34
|
+
|
|
35
|
+
protected readonly id = 'theia-notification-center';
|
|
36
|
+
|
|
37
|
+
@inject(NotificationManager)
|
|
38
|
+
protected readonly manager: NotificationManager;
|
|
39
|
+
|
|
40
|
+
@inject(NotificationsRenderer)
|
|
41
|
+
protected readonly notificationsRenderer: NotificationsRenderer; // required for initialization
|
|
42
|
+
|
|
43
|
+
@inject(StatusBar)
|
|
44
|
+
protected readonly statusBar: StatusBar;
|
|
45
|
+
|
|
46
|
+
onStart(_app: FrontendApplication): void {
|
|
47
|
+
this.createStatusBarItem();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected createStatusBarItem(): void {
|
|
51
|
+
this.updateStatusBarItem();
|
|
52
|
+
this.manager.onUpdated(e => this.updateStatusBarItem(e.notifications.length));
|
|
53
|
+
}
|
|
54
|
+
protected updateStatusBarItem(count: number = 0): void {
|
|
55
|
+
this.statusBar.setElement(this.id, {
|
|
56
|
+
text: this.getStatusBarItemText(count),
|
|
57
|
+
alignment: StatusBarAlignment.RIGHT,
|
|
58
|
+
priority: -900,
|
|
59
|
+
command: NotificationsCommands.TOGGLE.id,
|
|
60
|
+
tooltip: this.getStatusBarItemTooltip(count),
|
|
61
|
+
accessibilityInformation: {
|
|
62
|
+
label: this.getStatusBarItemTooltip(count)
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
protected getStatusBarItemText(count: number): string {
|
|
67
|
+
return `$(${count ? 'codicon-bell-dot' : 'codicon-bell'}) ${count ? ` ${count}` : ''}`;
|
|
68
|
+
}
|
|
69
|
+
protected getStatusBarItemTooltip(count: number): string {
|
|
70
|
+
if (this.manager.centerVisible) {
|
|
71
|
+
return nls.localizeByDefault('Hide Notifications');
|
|
72
|
+
}
|
|
73
|
+
return count === 0
|
|
74
|
+
? nls.localizeByDefault('No Notifications')
|
|
75
|
+
: count === 1
|
|
76
|
+
? nls.localizeByDefault('1 New Notification')
|
|
77
|
+
: nls.localizeByDefault('{0} New Notifications', count.toString());
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
registerCommands(commands: CommandRegistry): void {
|
|
81
|
+
commands.registerCommand(NotificationsCommands.TOGGLE, {
|
|
82
|
+
isEnabled: () => true,
|
|
83
|
+
execute: () => this.manager.toggleCenter()
|
|
84
|
+
});
|
|
85
|
+
commands.registerCommand(NotificationsCommands.SHOW, {
|
|
86
|
+
isEnabled: () => true,
|
|
87
|
+
execute: () => this.manager.showCenter()
|
|
88
|
+
});
|
|
89
|
+
commands.registerCommand(NotificationsCommands.HIDE, {
|
|
90
|
+
execute: () => this.manager.hide()
|
|
91
|
+
});
|
|
92
|
+
commands.registerCommand(NotificationsCommands.CLEAR_ALL, {
|
|
93
|
+
execute: () => this.manager.clearAll()
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
registerKeybindings(keybindings: KeybindingRegistry): void {
|
|
98
|
+
keybindings.registerKeybinding({
|
|
99
|
+
command: NotificationsCommands.HIDE.id,
|
|
100
|
+
when: 'notificationsVisible',
|
|
101
|
+
keybinding: 'esc'
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
registerColors(colors: ColorRegistry): void {
|
|
106
|
+
colors.register(
|
|
107
|
+
{
|
|
108
|
+
id: 'notificationCenter.border', defaults: {
|
|
109
|
+
hcDark: 'contrastBorder',
|
|
110
|
+
hcLight: 'contrastBorder'
|
|
111
|
+
}, description: 'Notifications center border color. Notifications slide in from the bottom right of the window.'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: 'notificationToast.border', defaults: {
|
|
115
|
+
hcDark: 'contrastBorder',
|
|
116
|
+
hcLight: 'contrastBorder'
|
|
117
|
+
}, description: 'Notification toast border color. Notifications slide in from the bottom right of the window.'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 'notifications.foreground', defaults: {
|
|
121
|
+
dark: 'editorWidget.foreground',
|
|
122
|
+
light: 'editorWidget.foreground',
|
|
123
|
+
hcDark: 'editorWidget.foreground',
|
|
124
|
+
hcLight: 'editorWidget.foreground'
|
|
125
|
+
}, description: 'Notifications foreground color. Notifications slide in from the bottom right of the window.'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'notifications.background', defaults: {
|
|
129
|
+
dark: 'editorWidget.background',
|
|
130
|
+
light: 'editorWidget.background',
|
|
131
|
+
hcDark: 'editorWidget.background',
|
|
132
|
+
hcLight: 'editorWidget.background'
|
|
133
|
+
}, description: 'Notifications background color. Notifications slide in from the bottom right of the window.'
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'notificationLink.foreground', defaults: {
|
|
137
|
+
dark: 'textLink.foreground',
|
|
138
|
+
light: 'textLink.foreground',
|
|
139
|
+
hcDark: 'textLink.foreground',
|
|
140
|
+
hcLight: 'textLink.foreground'
|
|
141
|
+
}, description: 'Notification links foreground color. Notifications slide in from the bottom right of the window.'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 'notificationCenterHeader.foreground',
|
|
145
|
+
description: 'Notifications center header foreground color. Notifications slide in from the bottom right of the window.'
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 'notificationCenterHeader.background', defaults: {
|
|
149
|
+
dark: Color.lighten('notifications.background', 0.3),
|
|
150
|
+
light: Color.darken('notifications.background', 0.05),
|
|
151
|
+
hcDark: 'notifications.background',
|
|
152
|
+
hcLight: 'notifications.background'
|
|
153
|
+
}, description: 'Notifications center header background color. Notifications slide in from the bottom right of the window.'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 'notifications.border', defaults: {
|
|
157
|
+
dark: 'notificationCenterHeader.background',
|
|
158
|
+
light: 'notificationCenterHeader.background',
|
|
159
|
+
hcDark: 'notificationCenterHeader.background',
|
|
160
|
+
hcLight: 'notificationCenterHeader.background'
|
|
161
|
+
// eslint-disable-next-line max-len
|
|
162
|
+
}, description: 'Notifications border color separating from other notifications in the notifications center. Notifications slide in from the bottom right of the window.'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 'notificationsErrorIcon.foreground', defaults: {
|
|
166
|
+
dark: 'editorError.foreground',
|
|
167
|
+
light: 'editorError.foreground',
|
|
168
|
+
hcDark: 'editorError.foreground',
|
|
169
|
+
hcLight: 'editorError.foreground'
|
|
170
|
+
}, description: 'The color used for the icon of error notifications. Notifications slide in from the bottom right of the window.'
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 'notificationsWarningIcon.foreground', defaults: {
|
|
174
|
+
dark: 'editorWarning.foreground',
|
|
175
|
+
light: 'editorWarning.foreground',
|
|
176
|
+
hcDark: 'editorWarning.foreground',
|
|
177
|
+
hcLight: 'editorWarning.foreground'
|
|
178
|
+
}, description: 'The color used for the icon of warning notifications. Notifications slide in from the bottom right of the window.'
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: 'notificationsInfoIcon.foreground', defaults: {
|
|
182
|
+
dark: 'editorInfo.foreground',
|
|
183
|
+
light: 'editorInfo.foreground',
|
|
184
|
+
hcDark: 'editorInfo.foreground',
|
|
185
|
+
hcLight: 'editorInfo.foreground'
|
|
186
|
+
}, description: 'The color used for the icon of info notifications. Notifications slide in from the bottom right of the window.'
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
registerThemeStyle(theme: ColorTheme, collector: CssStyleCollector): void {
|
|
192
|
+
const notificationsBackground = theme.getColor('notifications.background');
|
|
193
|
+
if (notificationsBackground) {
|
|
194
|
+
collector.addRule(`
|
|
195
|
+
.theia-notification-list-item-container {
|
|
196
|
+
background-color: ${notificationsBackground};
|
|
197
|
+
}
|
|
198
|
+
`);
|
|
199
|
+
}
|
|
200
|
+
const notificationHover = theme.getColor('list.hoverBackground');
|
|
201
|
+
if (notificationHover) {
|
|
202
|
+
collector.addRule(`
|
|
203
|
+
.theia-notification-list-item:hover:not(:focus) {
|
|
204
|
+
background-color: ${notificationHover};
|
|
205
|
+
}
|
|
206
|
+
`);
|
|
207
|
+
}
|
|
208
|
+
const focusBorder = theme.getColor('focusBorder');
|
|
209
|
+
if (focusBorder && isHighContrast(theme.type)) {
|
|
210
|
+
collector.addRule(`
|
|
211
|
+
.theia-notification-list-item:hover:not(:focus) {
|
|
212
|
+
outline: 1px dashed ${focusBorder};
|
|
213
|
+
outline-offset: -2px;
|
|
214
|
+
}
|
|
215
|
+
`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|