@@ -22,7 +22,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
22
22
import { MenuItemAction , IMenuService , registerAction2 , MenuId , IAction2Options , MenuRegistry , Action2 } from 'vs/platform/actions/common/actions' ;
23
23
import { IAction , ActionRunner , Action , Separator } from 'vs/base/common/actions' ;
24
24
import { ActionBar , IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar' ;
25
- import { IThemeService , registerThemingParticipant , IFileIconTheme , ThemeIcon , IColorTheme , ICssStyleCollector } from 'vs/platform/theme/common/themeService' ;
25
+ import { IThemeService , IFileIconTheme , ThemeIcon } from 'vs/platform/theme/common/themeService' ;
26
26
import { isSCMResource , isSCMResourceGroup , connectPrimaryMenuToInlineActionBar , isSCMRepository , isSCMInput , collectContextMenuActions , getActionViewItemProvider , isSCMActionButton } from './util' ;
27
27
import { attachBadgeStyler , attachButtonStyler } from 'vs/platform/theme/common/styler' ;
28
28
import { WorkbenchCompressibleObjectTree , IOpenEvent } from 'vs/platform/list/browser/listService' ;
@@ -44,7 +44,7 @@ import { coalesce, flatten } from 'vs/base/common/arrays';
44
44
import { memoize } from 'vs/base/common/decorators' ;
45
45
import { IStorageService , StorageScope , StorageTarget , WillSaveStateReason } from 'vs/platform/storage/common/storage' ;
46
46
import { EditorResourceAccessor , SideBySideEditor } from 'vs/workbench/common/editor' ;
47
- import { SIDE_BAR_BACKGROUND , SIDE_BAR_BORDER , PANEL_BACKGROUND , PANEL_INPUT_BORDER } from 'vs/workbench/common/theme' ;
47
+ import { SIDE_BAR_BACKGROUND , PANEL_BACKGROUND } from 'vs/workbench/common/theme' ;
48
48
import { CodeEditorWidget , ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditorWidget' ;
49
49
import { ITextModel } from 'vs/editor/common/model' ;
50
50
import { IEditorConstructionOptions } from 'vs/editor/browser/config/editorConfiguration' ;
@@ -56,7 +56,6 @@ import { SelectionClipboardContributionID } from 'vs/workbench/contrib/codeEdito
56
56
import { ContextMenuController } from 'vs/editor/contrib/contextmenu/browser/contextmenu' ;
57
57
import * as platform from 'vs/base/common/platform' ;
58
58
import { compare , format } from 'vs/base/common/strings' ;
59
- import { inputPlaceholderForeground , inputValidationInfoBorder , inputValidationWarningBorder , inputValidationErrorBorder , inputValidationInfoBackground , inputValidationInfoForeground , inputValidationWarningBackground , inputValidationWarningForeground , inputValidationErrorBackground , inputValidationErrorForeground , inputBackground , inputForeground , inputBorder , focusBorder , registerColor , contrastBorder , editorSelectionBackground , selectionBackground , textLinkActiveForeground , textLinkForeground , buttonBorder } from 'vs/platform/theme/common/colorRegistry' ;
60
59
import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController' ;
61
60
import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2' ;
62
61
import { Schemas } from 'vs/base/common/network' ;
@@ -88,6 +87,7 @@ import { RepositoryContextKeys } from 'vs/workbench/contrib/scm/browser/scmViewS
88
87
import { DragAndDropController } from 'vs/editor/contrib/dnd/browser/dnd' ;
89
88
import { DropIntoEditorController } from 'vs/editor/contrib/dropIntoEditor/browser/dropIntoEditorContribution' ;
90
89
import { MessageController } from 'vs/editor/contrib/message/browser/messageController' ;
90
+ import { contrastBorder , registerColor } from 'vs/platform/theme/common/colorRegistry' ;
91
91
92
92
type TreeElement = ISCMRepository | ISCMInput | ISCMActionButton | ISCMResourceGroup | IResourceNode < ISCMResource , ISCMResourceGroup > | ISCMResource ;
93
93
@@ -2184,18 +2184,6 @@ class SCMInputWidget {
2184
2184
}
2185
2185
}
2186
2186
2187
- registerThemingParticipant ( ( theme : IColorTheme , collector : ICssStyleCollector ) => {
2188
- const link = theme . getColor ( textLinkForeground ) ;
2189
- if ( link ) {
2190
- collector . addRule ( `.scm-editor-validation a { color: ${ link } ; }` ) ;
2191
- }
2192
-
2193
- const activeLink = theme . getColor ( textLinkActiveForeground ) ;
2194
- if ( activeLink ) {
2195
- collector . addRule ( `.scm-editor-validation a:active, .scm-editor-validation a:hover { color: ${ activeLink } ; }` ) ;
2196
- }
2197
- } ) ;
2198
-
2199
2187
export class SCMViewPane extends ViewPane {
2200
2188
2201
2189
private _onDidLayout : Emitter < void > ;
@@ -2515,102 +2503,6 @@ export class SCMViewPane extends ViewPane {
2515
2503
2516
2504
export const scmProviderSeparatorBorderColor = registerColor ( 'scm.providerBorder' , { dark : '#454545' , light : '#C8C8C8' , hcDark : contrastBorder , hcLight : contrastBorder } , localize ( 'scm.providerBorder' , "SCM Provider separator border." ) ) ;
2517
2505
2518
- registerThemingParticipant ( ( theme , collector ) => {
2519
- const inputBackgroundColor = theme . getColor ( inputBackground ) ;
2520
- if ( inputBackgroundColor ) {
2521
- collector . addRule ( `.scm-view .scm-editor-container .monaco-editor-background,
2522
- .scm-view .scm-editor-container .monaco-editor,
2523
- .scm-view .scm-editor-container .monaco-editor .margin
2524
- { background-color: ${ inputBackgroundColor } !important; }` ) ;
2525
- }
2526
-
2527
- const selectionBackgroundColor = theme . getColor ( selectionBackground ) ?? theme . getColor ( editorSelectionBackground ) ;
2528
- if ( selectionBackgroundColor ) {
2529
- collector . addRule ( `.scm-view .scm-editor-container .monaco-editor .focused .selected-text { background-color: ${ selectionBackgroundColor } ; }` ) ;
2530
- }
2531
-
2532
- const inputForegroundColor = theme . getColor ( inputForeground ) ;
2533
- if ( inputForegroundColor ) {
2534
- collector . addRule ( `.scm-view .scm-editor-container .mtk1 { color: ${ inputForegroundColor } ; }` ) ;
2535
- }
2536
-
2537
- const inputBorderColor = theme . getColor ( inputBorder ) ;
2538
- if ( inputBorderColor ) {
2539
- collector . addRule ( `.scm-view .scm-editor-container { outline: 1px solid ${ inputBorderColor } ; }` ) ;
2540
- }
2541
-
2542
- const panelInputBorder = theme . getColor ( PANEL_INPUT_BORDER ) ;
2543
- if ( panelInputBorder ) {
2544
- collector . addRule ( `.monaco-workbench .part.panel .scm-view .scm-editor-container { outline: 1px solid ${ panelInputBorder } ; }` ) ;
2545
- }
2546
-
2547
- const buttonBorderColor = theme . getColor ( buttonBorder ) ;
2548
- collector . addRule ( `.scm-view .button-container .monaco-description-button { height: ${ buttonBorderColor ? '32px' : '30px' } ; }` ) ;
2549
-
2550
- const focusBorderColor = theme . getColor ( focusBorder ) ;
2551
- if ( focusBorderColor ) {
2552
- collector . addRule ( `.scm-view .scm-editor-container.synthetic-focus { outline: 1px solid ${ focusBorderColor } ; }` ) ;
2553
- }
2554
-
2555
- const inputPlaceholderForegroundColor = theme . getColor ( inputPlaceholderForeground ) ;
2556
- if ( inputPlaceholderForegroundColor ) {
2557
- collector . addRule ( `.scm-view .scm-editor-placeholder { color: ${ inputPlaceholderForegroundColor } ; }` ) ;
2558
- }
2559
-
2560
- const inputValidationInfoBorderColor = theme . getColor ( inputValidationInfoBorder ) ;
2561
- if ( inputValidationInfoBorderColor ) {
2562
- collector . addRule ( `.scm-view .scm-editor-container.validation-info { outline: 1px solid ${ inputValidationInfoBorderColor } !important; }` ) ;
2563
- collector . addRule ( `.scm-editor-validation-container.validation-info { border-color: ${ inputValidationInfoBorderColor } ; }` ) ;
2564
- }
2565
-
2566
- const inputValidationInfoBackgroundColor = theme . getColor ( inputValidationInfoBackground ) ;
2567
- if ( inputValidationInfoBackgroundColor ) {
2568
- collector . addRule ( `.scm-editor-validation-container.validation-info { background-color: ${ inputValidationInfoBackgroundColor } ; }` ) ;
2569
- }
2570
-
2571
- const inputValidationInfoForegroundColor = theme . getColor ( inputValidationInfoForeground ) ;
2572
- if ( inputValidationInfoForegroundColor ) {
2573
- collector . addRule ( `.scm-editor-validation-container.validation-info { color: ${ inputValidationInfoForegroundColor } ; }` ) ;
2574
- }
2575
-
2576
- const inputValidationWarningBorderColor = theme . getColor ( inputValidationWarningBorder ) ;
2577
- if ( inputValidationWarningBorderColor ) {
2578
- collector . addRule ( `.scm-view .scm-editor-container.validation-warning { outline: 1px solid ${ inputValidationWarningBorderColor } !important; }` ) ;
2579
- collector . addRule ( `.scm-editor-validation-container.validation-warning { border-color: ${ inputValidationWarningBorderColor } ; }` ) ;
2580
- }
2581
-
2582
- const inputValidationWarningBackgroundColor = theme . getColor ( inputValidationWarningBackground ) ;
2583
- if ( inputValidationWarningBackgroundColor ) {
2584
- collector . addRule ( `.scm-editor-validation-container.validation-warning { background-color: ${ inputValidationWarningBackgroundColor } ; }` ) ;
2585
- }
2586
-
2587
- const inputValidationWarningForegroundColor = theme . getColor ( inputValidationWarningForeground ) ;
2588
- if ( inputValidationWarningForegroundColor ) {
2589
- collector . addRule ( `.scm-editor-validation-container.validation-warning { color: ${ inputValidationWarningForegroundColor } ; }` ) ;
2590
- }
2591
-
2592
- const inputValidationErrorBorderColor = theme . getColor ( inputValidationErrorBorder ) ;
2593
- if ( inputValidationErrorBorderColor ) {
2594
- collector . addRule ( `.scm-view .scm-editor-container.validation-error { outline: 1px solid ${ inputValidationErrorBorderColor } !important; }` ) ;
2595
- collector . addRule ( `.scm-editor-validation-container.validation-error { border-color: ${ inputValidationErrorBorderColor } ; }` ) ;
2596
- }
2597
-
2598
- const inputValidationErrorBackgroundColor = theme . getColor ( inputValidationErrorBackground ) ;
2599
- if ( inputValidationErrorBackgroundColor ) {
2600
- collector . addRule ( `.scm-editor-validation-container.validation-error { background-color: ${ inputValidationErrorBackgroundColor } ; }` ) ;
2601
- }
2602
-
2603
- const inputValidationErrorForegroundColor = theme . getColor ( inputValidationErrorForeground ) ;
2604
- if ( inputValidationErrorForegroundColor ) {
2605
- collector . addRule ( `.scm-editor-validation-container.validation-error { color: ${ inputValidationErrorForegroundColor } ; }` ) ;
2606
- }
2607
-
2608
- const repositoryStatusActionsBorderColor = theme . getColor ( SIDE_BAR_BORDER ) ;
2609
- if ( repositoryStatusActionsBorderColor ) {
2610
- collector . addRule ( `.scm-view .scm-provider > .status > .monaco-action-bar > .actions-container { border-color: ${ repositoryStatusActionsBorderColor } ; }` ) ;
2611
- }
2612
- } ) ;
2613
-
2614
2506
export class SCMActionButton implements IDisposable {
2615
2507
private button : Button | ButtonWithDescription | ButtonWithDropdown | undefined ;
2616
2508
private readonly disposables = new MutableDisposable < DisposableStore > ( ) ;
0 commit comments