1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
18 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
19 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
21 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22 | };
|
23 | Object.defineProperty(exports, "__esModule", { value: true });
|
24 | exports.ButtonStylingParticipant = exports.TabbarStylingParticipant = exports.BadgeStylingParticipant = exports.MenuStylingParticipant = exports.StatusBarStylingParticipant = exports.BreadcrumbStylingParticipant = exports.TreeStylingParticipant = exports.ActionLabelStylingParticipant = exports.bindCommonStylingParticipants = void 0;
|
25 | const inversify_1 = require("inversify");
|
26 | const styling_service_1 = require("./styling-service");
|
27 | const theme_1 = require("../common/theme");
|
28 | function bindCommonStylingParticipants(bind) {
|
29 | for (const participant of [
|
30 | ActionLabelStylingParticipant,
|
31 | BadgeStylingParticipant,
|
32 | BreadcrumbStylingParticipant,
|
33 | ButtonStylingParticipant,
|
34 | MenuStylingParticipant,
|
35 | TabbarStylingParticipant,
|
36 | TreeStylingParticipant,
|
37 | StatusBarStylingParticipant
|
38 | ]) {
|
39 | bind(participant).toSelf().inSingletonScope();
|
40 | bind(styling_service_1.StylingParticipant).toService(participant);
|
41 | }
|
42 | }
|
43 | exports.bindCommonStylingParticipants = bindCommonStylingParticipants;
|
44 | let ActionLabelStylingParticipant = class ActionLabelStylingParticipant {
|
45 | registerThemeStyle(theme, collector) {
|
46 | const focusBorder = theme.getColor('focusBorder');
|
47 | if ((0, theme_1.isHighContrast)(theme.type) && focusBorder) {
|
48 | if (focusBorder) {
|
49 | collector.addRule(`
|
50 | .action-label:hover {
|
51 | outline: 1px dashed ${focusBorder};
|
52 | }
|
53 | `);
|
54 | }
|
55 | }
|
56 | }
|
57 | };
|
58 | ActionLabelStylingParticipant = __decorate([
|
59 | (0, inversify_1.injectable)()
|
60 | ], ActionLabelStylingParticipant);
|
61 | exports.ActionLabelStylingParticipant = ActionLabelStylingParticipant;
|
62 | let TreeStylingParticipant = class TreeStylingParticipant {
|
63 | registerThemeStyle(theme, collector) {
|
64 | const focusBorder = theme.getColor('focusBorder');
|
65 | if ((0, theme_1.isHighContrast)(theme.type) && focusBorder) {
|
66 | collector.addRule(`
|
67 | .theia-TreeNode {
|
68 | outline-offset: -1px;
|
69 | }
|
70 | .theia-TreeNode:hover {
|
71 | outline: 1px dashed ${focusBorder};
|
72 | }
|
73 | .theia-Tree .theia-TreeNode.theia-mod-selected {
|
74 | outline: 1px dotted ${focusBorder};
|
75 | }
|
76 | .theia-Tree:focus .theia-TreeNode.theia-mod-selected,
|
77 | .theia-Tree .ReactVirtualized__List:focus .theia-TreeNode.theia-mod-selected {
|
78 | outline: 1px solid ${focusBorder};
|
79 | }
|
80 | `);
|
81 | }
|
82 | }
|
83 | };
|
84 | TreeStylingParticipant = __decorate([
|
85 | (0, inversify_1.injectable)()
|
86 | ], TreeStylingParticipant);
|
87 | exports.TreeStylingParticipant = TreeStylingParticipant;
|
88 | let BreadcrumbStylingParticipant = class BreadcrumbStylingParticipant {
|
89 | registerThemeStyle(theme, collector) {
|
90 | const contrastBorder = theme.getColor('contrastBorder');
|
91 | if ((0, theme_1.isHighContrast)(theme.type) && contrastBorder) {
|
92 | collector.addRule(`
|
93 | .theia-tabBar-breadcrumb-row {
|
94 | outline: 1px solid ${contrastBorder};
|
95 | }
|
96 | `);
|
97 | }
|
98 | }
|
99 | };
|
100 | BreadcrumbStylingParticipant = __decorate([
|
101 | (0, inversify_1.injectable)()
|
102 | ], BreadcrumbStylingParticipant);
|
103 | exports.BreadcrumbStylingParticipant = BreadcrumbStylingParticipant;
|
104 | let StatusBarStylingParticipant = class StatusBarStylingParticipant {
|
105 | registerThemeStyle(theme, collector) {
|
106 | const focusBorder = theme.getColor('focusBorder');
|
107 | if ((0, theme_1.isHighContrast)(theme.type) && focusBorder) {
|
108 | collector.addRule(`
|
109 | #theia-statusBar .area .element.hasCommand:hover {
|
110 | outline: 1px dashed ${focusBorder};
|
111 | }
|
112 | #theia-statusBar .area .element.hasCommand:active {
|
113 | outline: 1px solid ${focusBorder};
|
114 | }
|
115 | .theia-mod-offline #theia-statusBar .area .element.hasCommand:hover {
|
116 | outline: none;
|
117 | }
|
118 | .theia-mod-offline #theia-statusBar .area .element.hasCommand:active {
|
119 | outline: none;
|
120 | }
|
121 | `);
|
122 | }
|
123 | else {
|
124 | collector.addRule(`
|
125 | #theia-statusBar .area .element.hasCommand:hover {
|
126 | background-color: var(--theia-statusBarItem-hoverBackground);
|
127 | }
|
128 | #theia-statusBar .area .element.hasCommand:active {
|
129 | background-color: var(--theia-statusBarItem-activeBackground);
|
130 | }
|
131 | .theia-mod-offline #theia-statusBar .area .element.hasCommand:hover {
|
132 | background-color: var(--theia-statusBarItem-offlineHoverBackground) !important;
|
133 | }
|
134 | .theia-mod-offline #theia-statusBar .area .element.hasCommand:active {
|
135 | background-color: var(--theia-statusBarItem-offlineActiveBackground) !important;
|
136 | }
|
137 | `);
|
138 | }
|
139 | }
|
140 | };
|
141 | StatusBarStylingParticipant = __decorate([
|
142 | (0, inversify_1.injectable)()
|
143 | ], StatusBarStylingParticipant);
|
144 | exports.StatusBarStylingParticipant = StatusBarStylingParticipant;
|
145 | let MenuStylingParticipant = class MenuStylingParticipant {
|
146 | registerThemeStyle(theme, collector) {
|
147 | const focusBorder = theme.getColor('focusBorder');
|
148 | if ((0, theme_1.isHighContrast)(theme.type) && focusBorder) {
|
149 |
|
150 | collector.addRule(`
|
151 | .p-Menu .p-Menu-item.p-mod-active {
|
152 | outline: 1px solid ${focusBorder};
|
153 | outline-offset: -1px;
|
154 | }
|
155 | .p-MenuBar .p-MenuBar-item.p-mod-active {
|
156 | outline: 1px dashed ${focusBorder};
|
157 | }
|
158 | .p-MenuBar.p-mod-active .p-MenuBar-item.p-mod-active {
|
159 | outline: 1px solid ${focusBorder};
|
160 | }
|
161 | `);
|
162 |
|
163 | collector.addRule(`
|
164 | .theia-sidebar-menu > :hover {
|
165 | outline: 1px dashed ${focusBorder};
|
166 | outline-offset: -7px;
|
167 | }
|
168 | `);
|
169 | }
|
170 | }
|
171 | };
|
172 | MenuStylingParticipant = __decorate([
|
173 | (0, inversify_1.injectable)()
|
174 | ], MenuStylingParticipant);
|
175 | exports.MenuStylingParticipant = MenuStylingParticipant;
|
176 | let BadgeStylingParticipant = class BadgeStylingParticipant {
|
177 | registerThemeStyle(theme, collector) {
|
178 | const contrastBorder = theme.getColor('contrastBorder');
|
179 | if ((0, theme_1.isHighContrast)(theme.type) && contrastBorder) {
|
180 | collector.addRule(`.p-TabBar .theia-badge-decorator-sidebar {
|
181 | outline: 1px solid ${contrastBorder};
|
182 | }`);
|
183 | }
|
184 | }
|
185 | };
|
186 | BadgeStylingParticipant = __decorate([
|
187 | (0, inversify_1.injectable)()
|
188 | ], BadgeStylingParticipant);
|
189 | exports.BadgeStylingParticipant = BadgeStylingParticipant;
|
190 | let TabbarStylingParticipant = class TabbarStylingParticipant {
|
191 | registerThemeStyle(theme, collector) {
|
192 | const focusBorder = theme.getColor('focusBorder');
|
193 | const contrastBorder = theme.getColor('contrastBorder');
|
194 | const highContrast = (0, theme_1.isHighContrast)(theme.type);
|
195 | if (highContrast && focusBorder) {
|
196 | collector.addRule(`
|
197 | #theia-bottom-content-panel .p-TabBar .p-TabBar-tab,
|
198 | #theia-main-content-panel .p-TabBar .p-TabBar-tab {
|
199 | outline-offset: -4px;
|
200 | }
|
201 | #theia-bottom-content-panel .p-TabBar .p-TabBar-tab.p-mod-current,
|
202 | #theia-main-content-panel .p-TabBar .p-TabBar-tab.p-mod-current {
|
203 | outline: 1px solid ${focusBorder};
|
204 | }
|
205 | #theia-bottom-content-panel .p-TabBar:not(.theia-tabBar-active) .p-TabBar-tab.p-mod-current,
|
206 | #theia-main-content-panel .p-TabBar:not(.theia-tabBar-active) .p-TabBar-tab.p-mod-current {
|
207 | outline: 1px dotted ${focusBorder};
|
208 | }
|
209 | #theia-bottom-content-panel .p-TabBar .p-TabBar-tab:not(.p-mod-current):hover,
|
210 | #theia-main-content-panel .p-TabBar .p-TabBar-tab:not(.p-mod-current):hover {
|
211 | outline: 1px dashed ${focusBorder};
|
212 | }
|
213 | `);
|
214 | }
|
215 | const tabActiveBackground = theme.getColor('tab.activeBackground');
|
216 | const tabActiveBorderTop = theme.getColor('tab.activeBorderTop');
|
217 | const tabUnfocusedActiveBorderTop = theme.getColor('tab.unfocusedActiveBorderTop');
|
218 | const tabActiveBorder = theme.getColor('tab.activeBorder') || (highContrast && contrastBorder) || 'transparent';
|
219 | const tabUnfocusedActiveBorder = theme.getColor('tab.unfocusedActiveBorder') || (highContrast && contrastBorder) || 'transparent';
|
220 | collector.addRule(`
|
221 | #theia-main-content-panel .p-TabBar .p-TabBar-tab.p-mod-current {
|
222 | color: var(--theia-tab-activeForeground);
|
223 | ${tabActiveBackground ? `background: ${tabActiveBackground};` : ''}
|
224 | ${tabActiveBorderTop ? `border-top: 1px solid ${tabActiveBorderTop};` : ''}
|
225 | border-bottom: 1px solid ${tabActiveBorder};
|
226 | }
|
227 | #theia-main-content-panel .p-TabBar:not(.theia-tabBar-active) .p-TabBar-tab.p-mod-current {
|
228 | background: var(--theia-tab-unfocusedActiveBackground);
|
229 | color: var(--theia-tab-unfocusedActiveForeground);
|
230 | ${tabUnfocusedActiveBorderTop ? `border-top: 1px solid ${tabUnfocusedActiveBorderTop};` : ''}
|
231 | border-bottom: 1px solid ${tabUnfocusedActiveBorder};
|
232 | }
|
233 | `);
|
234 |
|
235 | const tabActiveModifiedBorder = theme.getColor('tab.activeModifiedBorder');
|
236 | const tabUnfocusedInactiveModifiedBorder = theme.getColor('tab.unfocusedInactiveModifiedBorder');
|
237 | const tabInactiveModifiedBorder = theme.getColor('tab.inactiveModifiedBorder');
|
238 | if (tabActiveModifiedBorder || tabInactiveModifiedBorder) {
|
239 | collector.addRule(`
|
240 | body.theia-editor-highlightModifiedTabs
|
241 | #theia-main-content-panel .p-TabBar .p-TabBar-tab.theia-mod-dirty {
|
242 | border-top: 2px solid ${tabInactiveModifiedBorder};
|
243 | padding-bottom: 1px;
|
244 | }
|
245 |
|
246 | body.theia-editor-highlightModifiedTabs
|
247 | #theia-main-content-panel .p-TabBar.theia-tabBar-active .p-TabBar-tab.theia-mod-dirty.p-mod-current {
|
248 | border-top: 2px solid ${tabActiveModifiedBorder};
|
249 | }
|
250 |
|
251 | body.theia-editor-highlightModifiedTabs
|
252 | #theia-main-content-panel .p-TabBar:not(.theia-tabBar-active) .p-TabBar-tab.theia-mod-dirty:not(.p-mod-current) {
|
253 | border-top: 2px solid ${tabUnfocusedInactiveModifiedBorder};
|
254 | }
|
255 | `);
|
256 | }
|
257 |
|
258 | const activityBarActiveBorder = theme.getColor('activityBar.activeBorder') || 'var(--theia-activityBar-foreground)';
|
259 | collector.addRule(`
|
260 | .p-TabBar.theia-app-left .p-TabBar-tab.p-mod-current {
|
261 | border-top-color: transparent;
|
262 | box-shadow: 2px 0 0 ${activityBarActiveBorder} inset;
|
263 | }
|
264 |
|
265 | .p-TabBar.theia-app-right .p-TabBar-tab.p-mod-current {
|
266 | border-top-color: transparent;
|
267 | box-shadow: -2px 0 0 ${activityBarActiveBorder} inset;
|
268 | }
|
269 | `);
|
270 |
|
271 | const tabHoverBackground = theme.getColor('tab.hoverBackground');
|
272 | if (tabHoverBackground) {
|
273 | collector.addRule(`
|
274 | #theia-main-content-panel .p-TabBar .p-TabBar-tab:hover {
|
275 | background-color: ${tabHoverBackground};
|
276 | }
|
277 | `);
|
278 | }
|
279 | const tabUnfocusedHoverBackground = theme.getColor('tab.unfocusedHoverBackground');
|
280 | if (tabUnfocusedHoverBackground) {
|
281 | collector.addRule(`
|
282 | #theia-main-content-panel .p-TabBar:not(.theia-tabBar-active) .p-TabBar-tab:hover {
|
283 | background-color: ${tabUnfocusedHoverBackground};
|
284 | }
|
285 | `);
|
286 | }
|
287 |
|
288 | const tabHoverForeground = theme.getColor('tab.hoverForeground');
|
289 | if (tabHoverForeground) {
|
290 | collector.addRule(`
|
291 | #theia-main-content-panel .p-TabBar .p-TabBar-tab:hover {
|
292 | color: ${tabHoverForeground};
|
293 | }
|
294 | `);
|
295 | }
|
296 | const tabUnfocusedHoverForeground = theme.getColor('tab.unfocusedHoverForeground');
|
297 | if (tabUnfocusedHoverForeground) {
|
298 | collector.addRule(`
|
299 | #theia-main-content-panel .p-TabBar:not(.theia-tabBar-active) .p-TabBar-tab:hover {
|
300 | color: ${tabUnfocusedHoverForeground};
|
301 | }
|
302 | `);
|
303 | }
|
304 |
|
305 | const tabHoverBorder = theme.getColor('tab.hoverBorder');
|
306 | if (tabHoverBorder) {
|
307 | collector.addRule(`
|
308 | #theia-main-content-panel .p-TabBar .p-TabBar-tab:hover {
|
309 | box-shadow: 0 1px 0 ${tabHoverBorder} inset;
|
310 | }
|
311 | `);
|
312 | }
|
313 | const tabUnfocusedHoverBorder = theme.getColor('tab.unfocusedHoverBorder');
|
314 | if (tabUnfocusedHoverBorder) {
|
315 | collector.addRule(`
|
316 | #theia-main-content-panel .p-TabBar:not(.theia-tabBar-active) .p-TabBar-tab:hover {
|
317 | box-shadow: 0 1px 0 ${tabUnfocusedHoverBorder} inset;
|
318 | }
|
319 | `);
|
320 | }
|
321 | }
|
322 | };
|
323 | TabbarStylingParticipant = __decorate([
|
324 | (0, inversify_1.injectable)()
|
325 | ], TabbarStylingParticipant);
|
326 | exports.TabbarStylingParticipant = TabbarStylingParticipant;
|
327 | let ButtonStylingParticipant = class ButtonStylingParticipant {
|
328 | registerThemeStyle(theme, collector) {
|
329 | const contrastBorder = theme.getColor('contrastBorder');
|
330 | if ((0, theme_1.isHighContrast)(theme.type) && contrastBorder) {
|
331 | collector.addRule(`
|
332 | .theia-button {
|
333 | border: 1px solid ${contrastBorder};
|
334 | }
|
335 | `);
|
336 | }
|
337 | const buttonBackground = theme.getColor('button.background');
|
338 | collector.addRule(`
|
339 | .theia-button {
|
340 | background: ${buttonBackground || 'none'};
|
341 | }
|
342 | `);
|
343 | const buttonHoverBackground = theme.getColor('button.hoverBackground');
|
344 | if (buttonHoverBackground) {
|
345 | collector.addRule(`
|
346 | .theia-button:hover {
|
347 | background-color: ${buttonHoverBackground};
|
348 | }
|
349 | `);
|
350 | }
|
351 | const secondaryButtonBackground = theme.getColor('secondaryButton.background');
|
352 | collector.addRule(`
|
353 | .theia-button.secondary {
|
354 | background: ${secondaryButtonBackground || 'none'};
|
355 | }
|
356 | `);
|
357 | const secondaryButtonHoverBackground = theme.getColor('secondaryButton.hoverBackground');
|
358 | if (secondaryButtonHoverBackground) {
|
359 | collector.addRule(`
|
360 | .theia-button.secondary:hover {
|
361 | background-color: ${secondaryButtonHoverBackground};
|
362 | }
|
363 | `);
|
364 | }
|
365 | }
|
366 | };
|
367 | ButtonStylingParticipant = __decorate([
|
368 | (0, inversify_1.injectable)()
|
369 | ], ButtonStylingParticipant);
|
370 | exports.ButtonStylingParticipant = ButtonStylingParticipant;
|
371 |
|
\ | No newline at end of file |