mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-12 17:48:19 +01:00
@@ -13,6 +13,7 @@ import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { IDebugService, State, IDebugConfiguration } from 'vs/workbench/parts/debug/common/debug';
|
||||
import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { STATUS_BAR_DEBUGGING_FOREGROUND, isStatusbarInDebugMode } from 'vs/workbench/parts/debug/browser/statusbarColorProvider';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
@@ -61,7 +62,11 @@ export class DebugStatus extends Themable implements IStatusbarItem {
|
||||
protected updateStyles(): void {
|
||||
super.updateStyles();
|
||||
if (this.icon) {
|
||||
this.icon.style.backgroundColor = this.getColor(STATUS_BAR_FOREGROUND);
|
||||
if (isStatusbarInDebugMode(this.debugService)) {
|
||||
this.icon.style.backgroundColor = this.getColor(STATUS_BAR_DEBUGGING_FOREGROUND);
|
||||
} else {
|
||||
this.icon.style.backgroundColor = this.getColor(STATUS_BAR_FOREGROUND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
|
||||
super.updateStyles();
|
||||
|
||||
const container = this.partService.getContainer(Parts.STATUSBAR_PART);
|
||||
if (this.isDebugging()) {
|
||||
if (isStatusbarInDebugMode(this.debugService)) {
|
||||
addClass(container, 'debugging');
|
||||
} else {
|
||||
removeClass(container, 'debugging');
|
||||
@@ -84,7 +84,7 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
|
||||
private getColorKey(noFolderColor: string, debuggingColor: string, normalColor: string): string {
|
||||
|
||||
// Not debugging
|
||||
if (!this.isDebugging()) {
|
||||
if (!isStatusbarInDebugMode(this.debugService)) {
|
||||
if (this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY) {
|
||||
return normalColor;
|
||||
}
|
||||
@@ -95,24 +95,20 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
|
||||
// Debugging
|
||||
return debuggingColor;
|
||||
}
|
||||
}
|
||||
|
||||
private isDebugging(): boolean {
|
||||
if (this.debugService.state === State.Inactive || this.debugService.state === State.Initializing) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isRunningWithoutDebug()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
export function isStatusbarInDebugMode(debugService: IDebugService): boolean {
|
||||
if (debugService.state === State.Inactive || debugService.state === State.Initializing) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private isRunningWithoutDebug(): boolean {
|
||||
const process = this.debugService.getViewModel().focusedProcess;
|
||||
|
||||
return process && process.configuration && process.configuration.noDebug;
|
||||
const process = debugService.getViewModel().focusedProcess;
|
||||
const isRunningWithoutDebug = process && process.configuration && process.configuration.noDebug;
|
||||
if (isRunningWithoutDebug) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
@@ -120,4 +116,4 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
if (statusBarItemDebuggingForeground) {
|
||||
collector.addRule(`.monaco-workbench > .part.statusbar.debugging > .statusbar-item .mask-icon { background-color: ${statusBarItemDebuggingForeground} !important; }`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user