Skip to content

Commit 04ab6d1

Browse files
author
Benjamin Pasero
committed
list/tree: be consistent about not supporting inactive focus colors (for microsoft#46129)
1 parent e44ed5c commit 04ab6d1

4 files changed

Lines changed: 1 addition & 16 deletions

File tree

src/vs/base/browser/ui/list/listWidget.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,6 @@ export class DefaultStyleController implements IStyleController {
618618
content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; }`);
619619
}
620620

621-
if (styles.listInactiveFocusBackground) {
622-
content.push(`.monaco-list${suffix} .monaco-list-row.focused { background-color: ${styles.listInactiveFocusBackground}; }`);
623-
content.push(`.monaco-list${suffix} .monaco-list-row.focused:hover { background-color: ${styles.listInactiveFocusBackground}; }`); // overwrite :hover style in this case!
624-
}
625-
626621
if (styles.listInactiveSelectionBackground) {
627622
content.push(`.monaco-list${suffix} .monaco-list-row.selected { background-color: ${styles.listInactiveSelectionBackground}; }`);
628623
content.push(`.monaco-list${suffix} .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`); // overwrite :hover style in this case!
@@ -686,7 +681,6 @@ export interface IListStyles {
686681
listFocusAndSelectionForeground?: Color;
687682
listInactiveSelectionBackground?: Color;
688683
listInactiveSelectionForeground?: Color;
689-
listInactiveFocusBackground?: Color;
690684
listHoverBackground?: Color;
691685
listHoverForeground?: Color;
692686
listDropBackground?: Color;

src/vs/editor/contrib/suggest/suggestWidget.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
445445

446446
this.toDispose = [
447447
attachListStyler(this.list, themeService, {
448-
listInactiveFocusBackground: editorSuggestWidgetSelectedBackground,
449448
listInactiveFocusOutline: activeContrastBorder
450449
}),
451450
themeService.onThemeChange(t => this.onThemeChange(t)),

src/vs/platform/theme/common/colorRegistry.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ export const listActiveSelectionBackground = registerColor('list.activeSelection
192192
export const listActiveSelectionForeground = registerColor('list.activeSelectionForeground', { dark: Color.white, light: Color.white, hc: null }, nls.localize('listActiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not."));
193193
export const listInactiveSelectionBackground = registerColor('list.inactiveSelectionBackground', { dark: '#3F3F46', light: '#CCCEDB', hc: null }, nls.localize('listInactiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not."));
194194
export const listInactiveSelectionForeground = registerColor('list.inactiveSelectionForeground', { dark: null, light: null, hc: null }, nls.localize('listInactiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not."));
195-
export const listInactiveFocusBackground = registerColor('list.inactiveFocusBackground', { dark: '#313135', light: '#d8dae6', hc: null }, nls.localize('listInactiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not."));
196-
export const listInactiveFocusForeground = registerColor('list.inactiveFocusForeground', { dark: null, light: null, hc: null }, nls.localize('listInactiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not."));
197195
export const listHoverBackground = registerColor('list.hoverBackground', { dark: '#2A2D2E', light: '#F0F0F0', hc: null }, nls.localize('listHoverBackground', "List/Tree background when hovering over items using the mouse."));
198196
export const listHoverForeground = registerColor('list.hoverForeground', { dark: null, light: null, hc: null }, nls.localize('listHoverForeground', "List/Tree foreground when hovering over items using the mouse."));
199197
export const listDropBackground = registerColor('list.dropBackground', { dark: listFocusBackground, light: listFocusBackground, hc: null }, nls.localize('listDropBackground', "List/Tree drag and drop background when moving items around using the mouse."));

src/vs/platform/theme/common/styler.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'use strict';
77

88
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
9-
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusForeground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, lighten, badgeBackground, badgeForeground, progressBarBackground } from 'vs/platform/theme/common/colorRegistry';
9+
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, lighten, badgeBackground, badgeForeground, progressBarBackground } from 'vs/platform/theme/common/colorRegistry';
1010
import { IDisposable } from 'vs/base/common/lifecycle';
1111
import { Color } from 'vs/base/common/color';
1212
import { mixin } from 'vs/base/common/objects';
@@ -183,8 +183,6 @@ export function attachQuickOpenStyler(widget: IThemable, themeService: IThemeSer
183183
listFocusAndSelectionForeground: (style && style.listFocusAndSelectionForeground) || listActiveSelectionForeground,
184184
listInactiveSelectionBackground: (style && style.listInactiveSelectionBackground) || listInactiveSelectionBackground,
185185
listInactiveSelectionForeground: (style && style.listInactiveSelectionForeground) || listInactiveSelectionForeground,
186-
listInactiveFocusBackground: (style && style.listInactiveFocusBackground) || listInactiveFocusBackground,
187-
listInactiveFocusForeground: (style && style.listInactiveFocusForeground) || listInactiveFocusForeground,
188186
listHoverBackground: (style && style.listHoverBackground) || listHoverBackground,
189187
listHoverForeground: (style && style.listHoverForeground) || listHoverForeground,
190188
listDropBackground: (style && style.listDropBackground) || listDropBackground,
@@ -203,8 +201,6 @@ export interface IListStyleOverrides extends IStyleOverrides {
203201
listFocusAndSelectionForeground?: ColorIdentifier;
204202
listInactiveSelectionBackground?: ColorIdentifier;
205203
listInactiveSelectionForeground?: ColorIdentifier;
206-
listInactiveFocusBackground?: ColorIdentifier;
207-
listInactiveFocusForeground?: ColorIdentifier;
208204
listHoverBackground?: ColorIdentifier;
209205
listHoverForeground?: ColorIdentifier;
210206
listDropBackground?: ColorIdentifier;
@@ -227,8 +223,6 @@ export const defaultListStyles: IColorMapping = {
227223
listFocusAndSelectionForeground: listActiveSelectionForeground,
228224
listInactiveSelectionBackground: listInactiveSelectionBackground,
229225
listInactiveSelectionForeground: listInactiveSelectionForeground,
230-
listInactiveFocusBackground: listInactiveFocusBackground,
231-
listInactiveFocusForeground: listInactiveFocusForeground,
232226
listHoverBackground: listHoverBackground,
233227
listHoverForeground: listHoverForeground,
234228
listDropBackground: listDropBackground,

0 commit comments

Comments
 (0)