From fb52f252c28f5d3792cbecbe041fa3ce2c4bb30e Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 5 Mar 2018 11:58:38 +0100 Subject: [PATCH] debug status: respect debugging foreground color for icon fixes #44989 --- .../parts/debug/browser/debugStatus.ts | 7 ++++- .../debug/browser/statusbarColorProvider.ts | 30 ++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/vs/workbench/parts/debug/browser/debugStatus.ts b/src/vs/workbench/parts/debug/browser/debugStatus.ts index 4d43982f5e7..9a68a1303e2 100644 --- a/src/vs/workbench/parts/debug/browser/debugStatus.ts +++ b/src/vs/workbench/parts/debug/browser/debugStatus.ts @@ -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); + } } } diff --git a/src/vs/workbench/parts/debug/browser/statusbarColorProvider.ts b/src/vs/workbench/parts/debug/browser/statusbarColorProvider.ts index 4afe110097b..d3393c3ae02 100644 --- a/src/vs/workbench/parts/debug/browser/statusbarColorProvider.ts +++ b/src/vs/workbench/parts/debug/browser/statusbarColorProvider.ts @@ -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; }`); } -}); \ No newline at end of file +});