|
4 | 4 | *--------------------------------------------------------------------------------------------*/ |
5 | 5 |
|
6 | 6 | import { IDragAndDropData } from 'vs/base/browser/dnd'; |
7 | | -import { createStyleSheet, Dimension, EventHelper } from 'vs/base/browser/dom'; |
| 7 | +import { asCssValueWithDefault, createStyleSheet, Dimension, EventHelper } from 'vs/base/browser/dom'; |
8 | 8 | import { DomEmitter } from 'vs/base/browser/event'; |
9 | 9 | import { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; |
10 | 10 | import { Gesture } from 'vs/base/browser/touch'; |
@@ -820,10 +820,6 @@ export class DefaultStyleController implements IStyleController { |
820 | 820 | content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected .codicon { color: ${styles.listActiveSelectionIconForeground}; }`); |
821 | 821 | } |
822 | 822 |
|
823 | | - if (styles.listFocusAndSelectionOutline) { |
824 | | - content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { outline-color: ${styles.listFocusAndSelectionOutline} !important; }`); |
825 | | - } |
826 | | - |
827 | 823 | if (styles.listFocusAndSelectionBackground) { |
828 | 824 | content.push(` |
829 | 825 | .monaco-drag-image, |
@@ -869,23 +865,36 @@ export class DefaultStyleController implements IStyleController { |
869 | 865 | content.push(`.monaco-list${suffix}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`); |
870 | 866 | } |
871 | 867 |
|
872 | | - if (styles.listSelectionOutline) { |
873 | | - content.push(`.monaco-list${suffix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`); |
| 868 | + /** |
| 869 | + * Outlines |
| 870 | + */ |
| 871 | + const focusAndSelectionOutline = asCssValueWithDefault(styles.listFocusAndSelectionOutline, asCssValueWithDefault(styles.listSelectionOutline, styles.listFocusOutline ?? '')); |
| 872 | + if (focusAndSelectionOutline) { // default: listFocusOutline |
| 873 | + content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused.selected { outline: 1px solid ${focusAndSelectionOutline}; outline-offset: -1px;}`); |
874 | 874 | } |
875 | 875 |
|
876 | | - if (styles.listFocusOutline) { |
| 876 | + if (styles.listFocusOutline) { // default: set |
877 | 877 | content.push(` |
878 | 878 | .monaco-drag-image, |
879 | 879 | .monaco-list${suffix}:focus .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; } |
880 | 880 | .monaco-workbench.context-menu-visible .monaco-list${suffix}.last-focused .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; } |
881 | 881 | `); |
882 | 882 | } |
883 | 883 |
|
884 | | - if (styles.listInactiveFocusOutline) { |
| 884 | + const inactiveFocusAndSelectionOutline = asCssValueWithDefault(styles.listSelectionOutline, styles.listInactiveFocusOutline ?? ''); |
| 885 | + if (inactiveFocusAndSelectionOutline) { |
| 886 | + content.push(`.monaco-list${suffix} .monaco-list-row.focused.selected { outline: 1px dotted ${inactiveFocusAndSelectionOutline}; outline-offset: -1px; }`); |
| 887 | + } |
| 888 | + |
| 889 | + if (styles.listSelectionOutline) { // default: activeContrastBorder |
| 890 | + content.push(`.monaco-list${suffix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`); |
| 891 | + } |
| 892 | + |
| 893 | + if (styles.listInactiveFocusOutline) { // default: null |
885 | 894 | content.push(`.monaco-list${suffix} .monaco-list-row.focused { outline: 1px dotted ${styles.listInactiveFocusOutline}; outline-offset: -1px; }`); |
886 | 895 | } |
887 | 896 |
|
888 | | - if (styles.listHoverOutline) { |
| 897 | + if (styles.listHoverOutline) { // default: activeContrastBorder |
889 | 898 | content.push(`.monaco-list${suffix} .monaco-list-row:hover { outline: 1px dashed ${styles.listHoverOutline}; outline-offset: -1px; }`); |
890 | 899 | } |
891 | 900 |
|
|
0 commit comments