Skip to content

Commit 7d99677

Browse files
authored
fix quick fix css (microsoft#162084)
1 parent 63abb75 commit 7d99677

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

src/vs/workbench/contrib/terminal/browser/media/terminal.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@
248248
border-style: solid;
249249
}
250250

251+
.xterm-screen .xterm-decoration-container .xterm-decoration.quick-fix {
252+
z-index: 7;
253+
}
254+
251255
.monaco-workbench .part.sidebar > .title > .title-actions .switch-terminal {
252256
display: flex;
253257
align-items: center;

src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export const enum DecorationSelector {
2020
Codicon = 'codicon',
2121
XtermDecoration = 'xterm-decoration',
2222
OverviewRuler = '.xterm-decoration-overview-ruler',
23-
QuickFix = 'codicon-light-bulb'
23+
QuickFix = 'quick-fix',
24+
LightBulb = 'codicon-light-bulb'
2425
}
2526

2627
export function updateLayout(configurationService: IConfigurationService, element?: HTMLElement): void {

src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import { DecorationSelector, updateLayout } from 'vs/workbench/contrib/terminal/
1515
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
1616
import { Terminal, IDecoration } from 'xterm';
1717
import { IAction } from 'vs/base/common/actions';
18+
import { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
19+
import { PANEL_BACKGROUND } from 'vs/workbench/common/theme';
20+
import { TERMINAL_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry';
21+
import { Color } from 'vs/base/common/color';
1822

1923
export interface ITerminalQuickFix {
2024
showMenu(): void;
@@ -115,8 +119,7 @@ export class TerminalQuickFixAddon extends Disposable implements ITerminalAddon,
115119
decoration?.onRender((e: HTMLElement) => {
116120
if (!this._decorationMarkerIds.has(decoration.marker.id)) {
117121
this._currentQuickFixElement = e;
118-
e.classList.add(DecorationSelector.QuickFix, DecorationSelector.Codicon, DecorationSelector.CommandDecoration, DecorationSelector.XtermDecoration);
119-
e.style.color = '#ffcc00';
122+
e.classList.add(DecorationSelector.QuickFix, DecorationSelector.LightBulb, DecorationSelector.Codicon, DecorationSelector.CommandDecoration, DecorationSelector.XtermDecoration);
120123
updateLayout(this._configurationService, e);
121124
if (actions) {
122125
this._decorationMarkerIds.add(decoration.marker.id);
@@ -168,3 +171,16 @@ export function getQuickFixes(command: ITerminalCommand, actionOptions: Map<stri
168171
}
169172
return actions.length === 0 ? undefined : actions;
170173
}
174+
175+
let foregroundColor: string | Color | undefined;
176+
let backgroundColor: string | Color | undefined;
177+
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
178+
foregroundColor = theme.getColor('editorLightBulb.foreground');
179+
backgroundColor = theme.getColor(TERMINAL_BACKGROUND_COLOR) || theme.getColor(PANEL_BACKGROUND);
180+
if (foregroundColor) {
181+
collector.addRule(`.${DecorationSelector.CommandDecoration}.${DecorationSelector.QuickFix} { color: ${foregroundColor.toString()} !important; } `);
182+
}
183+
if (backgroundColor) {
184+
collector.addRule(`.${DecorationSelector.CommandDecoration}.${DecorationSelector.QuickFix} { background-color: ${backgroundColor.toString()}; } `);
185+
}
186+
});

0 commit comments

Comments
 (0)