@@ -23,7 +23,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
23
23
import { MenuItemAction , IMenuService , registerAction2 , MenuId , IAction2Options , MenuRegistry , Action2 , IMenu } from 'vs/platform/actions/common/actions' ;
24
24
import { IAction , ActionRunner , Action , Separator , IActionRunner } from 'vs/base/common/actions' ;
25
25
import { ActionBar , IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar' ;
26
- import { IThemeService , IFileIconTheme } from 'vs/platform/theme/common/themeService' ;
26
+ import { IThemeService , IFileIconTheme , registerThemingParticipant } from 'vs/platform/theme/common/themeService' ;
27
27
import { isSCMResource , isSCMResourceGroup , connectPrimaryMenuToInlineActionBar , isSCMRepository , isSCMInput , collectContextMenuActions , getActionViewItemProvider , isSCMActionButton , isSCMViewService , isSCMHistoryItemGroupTreeElement , isSCMHistoryItemTreeElement , isSCMHistoryItemChangeTreeElement , toDiffEditorArguments , isSCMResourceNode , isSCMHistoryItemChangeNode , isSCMViewSeparator , connectPrimaryMenu , isSCMHistoryItemViewModelTreeElement } from './util' ;
28
28
import { WorkbenchCompressibleAsyncDataTree , IOpenEvent } from 'vs/platform/list/browser/listService' ;
29
29
import { IConfigurationService , ConfigurationTarget } from 'vs/platform/configuration/common/configuration' ;
@@ -96,7 +96,7 @@ import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'
96
96
import { EditOperation } from 'vs/editor/common/core/editOperation' ;
97
97
import { stripIcons } from 'vs/base/common/iconLabels' ;
98
98
import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel' ;
99
- import { foreground , listActiveSelectionForeground , registerColor , transparent } from 'vs/platform/theme/common/colorRegistry' ;
99
+ import { editorSelectionBackground , foreground , inputBackground , inputForeground , listActiveSelectionForeground , registerColor , selectionBackground , transparent } from 'vs/platform/theme/common/colorRegistry' ;
100
100
import { IMenuWorkbenchToolBarOptions , MenuWorkbenchToolBar , WorkbenchToolBar } from 'vs/platform/actions/browser/toolbar' ;
101
101
import { CancellationTokenSource } from 'vs/base/common/cancellation' ;
102
102
import { DropdownWithPrimaryActionViewItem } from 'vs/platform/actions/browser/dropdownWithPrimaryActionViewItem' ;
@@ -4246,3 +4246,31 @@ export class SCMActionButton implements IDisposable {
4246
4246
}
4247
4247
}
4248
4248
}
4249
+
4250
+ // Override styles in selections.ts
4251
+ registerThemingParticipant ( ( theme , collector ) => {
4252
+ const selectionBackgroundColor = theme . getColor ( selectionBackground ) ;
4253
+
4254
+ if ( selectionBackgroundColor ) {
4255
+ // Override inactive selection bg
4256
+ const inputBackgroundColor = theme . getColor ( inputBackground ) ;
4257
+ if ( inputBackgroundColor ) {
4258
+ collector . addRule ( `.scm-view .scm-editor-container .monaco-editor .selected-text { background-color: ${ inputBackgroundColor . transparent ( 0.4 ) } ; }` ) ;
4259
+ }
4260
+
4261
+ // Override selected fg
4262
+ const inputForegroundColor = theme . getColor ( inputForeground ) ;
4263
+ if ( inputForegroundColor ) {
4264
+ collector . addRule ( `.scm-view .scm-editor-container .monaco-editor .view-line span.inline-selected-text { color: ${ inputForegroundColor } ; }` ) ;
4265
+ }
4266
+
4267
+ const backgroundColor = theme . getColor ( inputBackground ) ;
4268
+ if ( backgroundColor ) {
4269
+ collector . addRule ( `.scm-view .scm-editor-container .monaco-editor-background { background-color: ${ backgroundColor } ; } ` ) ;
4270
+ }
4271
+ collector . addRule ( `.scm-view .scm-editor-container .monaco-editor .focused .selected-text { background-color: ${ selectionBackgroundColor } ; }` ) ;
4272
+ } else {
4273
+ // Use editor selection color if theme has not set a selection background color
4274
+ collector . addRule ( `.scm-view .scm-editor-container .monaco-editor .focused .selected-text { background-color: ${ theme . getColor ( editorSelectionBackground ) } ; }` ) ;
4275
+ }
4276
+ } ) ;
0 commit comments