Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f7c65e63
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f7c65e63
编写于
2月 07, 2019
作者:
M
Martin Aeschlimann
提交者:
GitHub
2月 07, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #68026 from mjbvz/getColor-ret-undefined
Change `ITheme.getColor` to returned `Color | undefined`
上级
bfa8c3d0
05c58615
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
71 addition
and
71 deletion
+71
-71
src/vs/editor/contrib/find/findOptionsWidget.ts
src/vs/editor/contrib/find/findOptionsWidget.ts
+2
-2
src/vs/editor/contrib/find/findWidget.ts
src/vs/editor/contrib/find/findWidget.ts
+14
-14
src/vs/editor/contrib/find/simpleFindWidget.ts
src/vs/editor/contrib/find/simpleFindWidget.ts
+13
-13
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
+1
-1
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
+2
-2
src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts
...s/editor/standalone/browser/standaloneThemeServiceImpl.ts
+4
-4
src/vs/platform/theme/common/colorRegistry.ts
src/vs/platform/theme/common/colorRegistry.ts
+12
-12
src/vs/platform/theme/common/styler.ts
src/vs/platform/theme/common/styler.ts
+2
-2
src/vs/platform/theme/common/themeService.ts
src/vs/platform/theme/common/themeService.ts
+1
-1
src/vs/platform/theme/test/common/testThemeService.ts
src/vs/platform/theme/test/common/testThemeService.ts
+2
-2
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
+12
-12
src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts
...orkbench/parts/scm/electron-browser/dirtydiffDecorator.ts
+3
-3
src/vs/workbench/services/themes/electron-browser/colorThemeData.ts
...kbench/services/themes/electron-browser/colorThemeData.ts
+3
-3
未找到文件。
src/vs/editor/contrib/find/findOptionsWidget.ts
浏览文件 @
f7c65e63
...
@@ -46,7 +46,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget {
...
@@ -46,7 +46,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget {
this
.
_domNode
.
setAttribute
(
'
role
'
,
'
presentation
'
);
this
.
_domNode
.
setAttribute
(
'
role
'
,
'
presentation
'
);
this
.
_domNode
.
setAttribute
(
'
aria-hidden
'
,
'
true
'
);
this
.
_domNode
.
setAttribute
(
'
aria-hidden
'
,
'
true
'
);
const
inputActiveOptionBorderColor
=
themeService
.
getTheme
().
getColor
(
inputActiveOptionBorder
)
||
undefined
;
const
inputActiveOptionBorderColor
=
themeService
.
getTheme
().
getColor
(
inputActiveOptionBorder
);
this
.
caseSensitive
=
this
.
_register
(
new
CaseSensitiveCheckbox
({
this
.
caseSensitive
=
this
.
_register
(
new
CaseSensitiveCheckbox
({
appendTitle
:
this
.
_keybindingLabelFor
(
FIND_IDS
.
ToggleCaseSensitiveCommand
),
appendTitle
:
this
.
_keybindingLabelFor
(
FIND_IDS
.
ToggleCaseSensitiveCommand
),
...
@@ -179,7 +179,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget {
...
@@ -179,7 +179,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget {
}
}
private
_applyTheme
(
theme
:
ITheme
)
{
private
_applyTheme
(
theme
:
ITheme
)
{
let
inputStyles
=
{
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
)
||
undefined
};
let
inputStyles
=
{
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
)
};
this
.
caseSensitive
.
style
(
inputStyles
);
this
.
caseSensitive
.
style
(
inputStyles
);
this
.
wholeWords
.
style
(
inputStyles
);
this
.
wholeWords
.
style
(
inputStyles
);
this
.
regex
.
style
(
inputStyles
);
this
.
regex
.
style
(
inputStyles
);
...
...
src/vs/editor/contrib/find/findWidget.ts
浏览文件 @
f7c65e63
...
@@ -530,19 +530,19 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
...
@@ -530,19 +530,19 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
private
_applyTheme
(
theme
:
ITheme
)
{
private
_applyTheme
(
theme
:
ITheme
)
{
let
inputStyles
:
IFindInputStyles
=
{
let
inputStyles
:
IFindInputStyles
=
{
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
)
||
undefined
,
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
),
inputBackground
:
theme
.
getColor
(
inputBackground
)
||
undefined
,
inputBackground
:
theme
.
getColor
(
inputBackground
),
inputForeground
:
theme
.
getColor
(
inputForeground
)
||
undefined
,
inputForeground
:
theme
.
getColor
(
inputForeground
),
inputBorder
:
theme
.
getColor
(
inputBorder
)
||
undefined
,
inputBorder
:
theme
.
getColor
(
inputBorder
),
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
)
||
undefined
,
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
),
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
)
||
undefined
,
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
),
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
)
||
undefined
,
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
),
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
)
||
undefined
,
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
),
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
)
||
undefined
,
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
),
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
)
||
undefined
,
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
),
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
)
||
undefined
,
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
),
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
)
||
undefined
,
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
),
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
||
undefined
,
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
),
};
};
this
.
_findInput
.
style
(
inputStyles
);
this
.
_findInput
.
style
(
inputStyles
);
this
.
_replaceInputBox
.
style
(
inputStyles
);
this
.
_replaceInputBox
.
style
(
inputStyles
);
...
@@ -1130,7 +1130,7 @@ export class SimpleButton extends Widget {
...
@@ -1130,7 +1130,7 @@ export class SimpleButton extends Widget {
// theming
// theming
registerThemingParticipant
((
theme
,
collector
)
=>
{
registerThemingParticipant
((
theme
,
collector
)
=>
{
const
addBackgroundColorRule
=
(
selector
:
string
,
color
:
Color
|
null
):
void
=>
{
const
addBackgroundColorRule
=
(
selector
:
string
,
color
:
Color
|
undefined
):
void
=>
{
if
(
color
)
{
if
(
color
)
{
collector
.
addRule
(
`.monaco-editor
${
selector
}
{ background-color:
${
color
}
; }`
);
collector
.
addRule
(
`.monaco-editor
${
selector
}
{ background-color:
${
color
}
; }`
);
}
}
...
...
src/vs/editor/contrib/find/simpleFindWidget.ts
浏览文件 @
f7c65e63
...
@@ -160,19 +160,19 @@ export abstract class SimpleFindWidget extends Widget {
...
@@ -160,19 +160,19 @@ export abstract class SimpleFindWidget extends Widget {
public
updateTheme
(
theme
:
ITheme
):
void
{
public
updateTheme
(
theme
:
ITheme
):
void
{
const
inputStyles
:
IFindInputStyles
=
{
const
inputStyles
:
IFindInputStyles
=
{
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
)
||
undefined
,
inputActiveOptionBorder
:
theme
.
getColor
(
inputActiveOptionBorder
),
inputBackground
:
theme
.
getColor
(
inputBackground
)
||
undefined
,
inputBackground
:
theme
.
getColor
(
inputBackground
),
inputForeground
:
theme
.
getColor
(
inputForeground
)
||
undefined
,
inputForeground
:
theme
.
getColor
(
inputForeground
),
inputBorder
:
theme
.
getColor
(
inputBorder
)
||
undefined
,
inputBorder
:
theme
.
getColor
(
inputBorder
),
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
)
||
undefined
,
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
),
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
)
||
undefined
,
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
),
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
)
||
undefined
,
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
),
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
)
||
undefined
,
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
),
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
)
||
undefined
,
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
),
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
)
||
undefined
,
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
),
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
)
||
undefined
,
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
),
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
)
||
undefined
,
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
),
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
||
undefined
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
};
};
this
.
_findInput
.
style
(
inputStyles
);
this
.
_findInput
.
style
(
inputStyles
);
}
}
...
...
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
浏览文件 @
f7c65e63
...
@@ -185,7 +185,7 @@ export class MarkerNavigationWidget extends ZoneWidget {
...
@@ -185,7 +185,7 @@ export class MarkerNavigationWidget extends ZoneWidget {
}
}
private
_applyTheme
(
theme
:
ITheme
)
{
private
_applyTheme
(
theme
:
ITheme
)
{
this
.
_backgroundColor
=
theme
.
getColor
(
editorMarkerNavigationBackground
)
||
undefined
;
this
.
_backgroundColor
=
theme
.
getColor
(
editorMarkerNavigationBackground
);
let
colorId
=
editorMarkerNavigationError
;
let
colorId
=
editorMarkerNavigationError
;
if
(
this
.
_severity
===
MarkerSeverity
.
Warning
)
{
if
(
this
.
_severity
===
MarkerSeverity
.
Warning
)
{
colorId
=
editorMarkerNavigationWarning
;
colorId
=
editorMarkerNavigationWarning
;
...
...
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
浏览文件 @
f7c65e63
...
@@ -279,8 +279,8 @@ export class ReferenceWidget extends PeekViewWidget {
...
@@ -279,8 +279,8 @@ export class ReferenceWidget extends PeekViewWidget {
arrowColor
:
borderColor
,
arrowColor
:
borderColor
,
frameColor
:
borderColor
,
frameColor
:
borderColor
,
headerBackgroundColor
:
theme
.
getColor
(
peekViewTitleBackground
)
||
Color
.
transparent
,
headerBackgroundColor
:
theme
.
getColor
(
peekViewTitleBackground
)
||
Color
.
transparent
,
primaryHeadingColor
:
theme
.
getColor
(
peekViewTitleForeground
)
||
undefined
,
primaryHeadingColor
:
theme
.
getColor
(
peekViewTitleForeground
),
secondaryHeadingColor
:
theme
.
getColor
(
peekViewTitleInfoForeground
)
||
undefined
secondaryHeadingColor
:
theme
.
getColor
(
peekViewTitleInfoForeground
)
});
});
}
}
...
...
src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts
浏览文件 @
f7c65e63
...
@@ -28,7 +28,7 @@ class StandaloneTheme implements IStandaloneTheme {
...
@@ -28,7 +28,7 @@ class StandaloneTheme implements IStandaloneTheme {
private
themeData
:
IStandaloneThemeData
;
private
themeData
:
IStandaloneThemeData
;
private
colors
:
{
[
colorId
:
string
]:
Color
}
|
null
;
private
colors
:
{
[
colorId
:
string
]:
Color
}
|
null
;
private
defaultColors
:
{
[
colorId
:
string
]:
Color
|
null
;
};
private
defaultColors
:
{
[
colorId
:
string
]:
Color
|
undefined
;
};
private
_tokenTheme
:
TokenTheme
|
null
;
private
_tokenTheme
:
TokenTheme
|
null
;
constructor
(
name
:
string
,
standaloneThemeData
:
IStandaloneThemeData
)
{
constructor
(
name
:
string
,
standaloneThemeData
:
IStandaloneThemeData
)
{
...
@@ -77,7 +77,7 @@ class StandaloneTheme implements IStandaloneTheme {
...
@@ -77,7 +77,7 @@ class StandaloneTheme implements IStandaloneTheme {
return
this
.
colors
;
return
this
.
colors
;
}
}
public
getColor
(
colorId
:
ColorIdentifier
,
useDefault
?:
boolean
):
Color
|
null
{
public
getColor
(
colorId
:
ColorIdentifier
,
useDefault
?:
boolean
):
Color
|
undefined
{
const
color
=
this
.
getColors
()[
colorId
];
const
color
=
this
.
getColors
()[
colorId
];
if
(
color
)
{
if
(
color
)
{
return
color
;
return
color
;
...
@@ -85,10 +85,10 @@ class StandaloneTheme implements IStandaloneTheme {
...
@@ -85,10 +85,10 @@ class StandaloneTheme implements IStandaloneTheme {
if
(
useDefault
!==
false
)
{
if
(
useDefault
!==
false
)
{
return
this
.
getDefault
(
colorId
);
return
this
.
getDefault
(
colorId
);
}
}
return
null
;
return
undefined
;
}
}
private
getDefault
(
colorId
:
ColorIdentifier
):
Color
|
null
{
private
getDefault
(
colorId
:
ColorIdentifier
):
Color
|
undefined
{
let
color
=
this
.
defaultColors
[
colorId
];
let
color
=
this
.
defaultColors
[
colorId
];
if
(
color
)
{
if
(
color
)
{
return
color
;
return
color
;
...
...
src/vs/platform/theme/common/colorRegistry.ts
浏览文件 @
f7c65e63
...
@@ -27,7 +27,7 @@ export interface ColorContribution {
...
@@ -27,7 +27,7 @@ export interface ColorContribution {
export
interface
ColorFunction
{
export
interface
ColorFunction
{
(
theme
:
ITheme
):
Color
|
null
;
(
theme
:
ITheme
):
Color
|
undefined
;
}
}
export
interface
ColorDefaults
{
export
interface
ColorDefaults
{
...
@@ -71,7 +71,7 @@ export interface IColorRegistry {
...
@@ -71,7 +71,7 @@ export interface IColorRegistry {
/**
/**
* Gets the default color of the given id
* Gets the default color of the given id
*/
*/
resolveDefaultColor
(
id
:
ColorIdentifier
,
theme
:
ITheme
):
Color
|
null
;
resolveDefaultColor
(
id
:
ColorIdentifier
,
theme
:
ITheme
):
Color
|
undefined
;
/**
/**
* JSON schema for an object to assign color values to one of the color contributions.
* JSON schema for an object to assign color values to one of the color contributions.
...
@@ -131,13 +131,13 @@ class ColorRegistry implements IColorRegistry {
...
@@ -131,13 +131,13 @@ class ColorRegistry implements IColorRegistry {
return
Object
.
keys
(
this
.
colorsById
).
map
(
id
=>
this
.
colorsById
[
id
]);
return
Object
.
keys
(
this
.
colorsById
).
map
(
id
=>
this
.
colorsById
[
id
]);
}
}
public
resolveDefaultColor
(
id
:
ColorIdentifier
,
theme
:
ITheme
):
Color
|
null
{
public
resolveDefaultColor
(
id
:
ColorIdentifier
,
theme
:
ITheme
):
Color
|
undefined
{
const
colorDesc
=
this
.
colorsById
[
id
];
const
colorDesc
=
this
.
colorsById
[
id
];
if
(
colorDesc
&&
colorDesc
.
defaults
)
{
if
(
colorDesc
&&
colorDesc
.
defaults
)
{
const
colorValue
=
colorDesc
.
defaults
[
theme
.
type
];
const
colorValue
=
colorDesc
.
defaults
[
theme
.
type
];
return
resolveColorValue
(
colorValue
,
theme
);
return
resolveColorValue
(
colorValue
,
theme
);
}
}
return
null
;
return
undefined
;
}
}
public
getColorSchema
():
IJSONSchema
{
public
getColorSchema
():
IJSONSchema
{
...
@@ -385,7 +385,7 @@ export function darken(colorValue: ColorValue, factor: number): ColorFunction {
...
@@ -385,7 +385,7 @@ export function darken(colorValue: ColorValue, factor: number): ColorFunction {
if
(
color
)
{
if
(
color
)
{
return
color
.
darken
(
factor
);
return
color
.
darken
(
factor
);
}
}
return
null
;
return
undefined
;
};
};
}
}
...
@@ -395,7 +395,7 @@ export function lighten(colorValue: ColorValue, factor: number): ColorFunction {
...
@@ -395,7 +395,7 @@ export function lighten(colorValue: ColorValue, factor: number): ColorFunction {
if
(
color
)
{
if
(
color
)
{
return
color
.
lighten
(
factor
);
return
color
.
lighten
(
factor
);
}
}
return
null
;
return
undefined
;
};
};
}
}
...
@@ -405,7 +405,7 @@ export function transparent(colorValue: ColorValue, factor: number): ColorFuncti
...
@@ -405,7 +405,7 @@ export function transparent(colorValue: ColorValue, factor: number): ColorFuncti
if
(
color
)
{
if
(
color
)
{
return
color
.
transparent
(
factor
);
return
color
.
transparent
(
factor
);
}
}
return
null
;
return
undefined
;
};
};
}
}
...
@@ -417,7 +417,7 @@ export function oneOf(...colorValues: ColorValue[]): ColorFunction {
...
@@ -417,7 +417,7 @@ export function oneOf(...colorValues: ColorValue[]): ColorFunction {
return
color
;
return
color
;
}
}
}
}
return
null
;
return
undefined
;
};
};
}
}
...
@@ -434,7 +434,7 @@ function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue,
...
@@ -434,7 +434,7 @@ function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue,
}
}
return
from
.
transparent
(
factor
*
transparency
);
return
from
.
transparent
(
factor
*
transparency
);
}
}
return
null
;
return
undefined
;
};
};
}
}
...
@@ -443,9 +443,9 @@ function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue,
...
@@ -443,9 +443,9 @@ function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue,
/**
/**
* @param colorValue Resolve a color value in the context of a theme
* @param colorValue Resolve a color value in the context of a theme
*/
*/
function
resolveColorValue
(
colorValue
:
ColorValue
|
null
,
theme
:
ITheme
):
Color
|
null
{
function
resolveColorValue
(
colorValue
:
ColorValue
|
null
,
theme
:
ITheme
):
Color
|
undefined
{
if
(
colorValue
===
null
)
{
if
(
colorValue
===
null
)
{
return
null
;
return
undefined
;
}
else
if
(
typeof
colorValue
===
'
string
'
)
{
}
else
if
(
typeof
colorValue
===
'
string
'
)
{
if
(
colorValue
[
0
]
===
'
#
'
)
{
if
(
colorValue
[
0
]
===
'
#
'
)
{
return
Color
.
fromHex
(
colorValue
);
return
Color
.
fromHex
(
colorValue
);
...
@@ -456,7 +456,7 @@ function resolveColorValue(colorValue: ColorValue | null, theme: ITheme): Color
...
@@ -456,7 +456,7 @@ function resolveColorValue(colorValue: ColorValue | null, theme: ITheme): Color
}
else
if
(
typeof
colorValue
===
'
function
'
)
{
}
else
if
(
typeof
colorValue
===
'
function
'
)
{
return
colorValue
(
theme
);
return
colorValue
(
theme
);
}
}
return
null
;
return
undefined
;
}
}
export
const
workbenchColorsSchemaId
=
'
vscode://schemas/workbench-colors
'
;
export
const
workbenchColorsSchemaId
=
'
vscode://schemas/workbench-colors
'
;
...
...
src/vs/platform/theme/common/styler.ts
浏览文件 @
f7c65e63
...
@@ -9,7 +9,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
...
@@ -9,7 +9,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
mixin
}
from
'
vs/base/common/objects
'
;
import
{
mixin
}
from
'
vs/base/common/objects
'
;
export
type
styleFn
=
(
colors
:
{
[
name
:
string
]:
Color
|
null
})
=>
void
;
export
type
styleFn
=
(
colors
:
{
[
name
:
string
]:
Color
|
undefined
})
=>
void
;
export
interface
IStyleOverrides
{
export
interface
IStyleOverrides
{
[
color
:
string
]:
ColorIdentifier
|
undefined
;
[
color
:
string
]:
ColorIdentifier
|
undefined
;
...
@@ -24,7 +24,7 @@ export interface IColorMapping {
...
@@ -24,7 +24,7 @@ export interface IColorMapping {
}
}
export
interface
IComputedStyles
{
export
interface
IComputedStyles
{
[
color
:
string
]:
Color
|
null
;
[
color
:
string
]:
Color
|
undefined
;
}
}
export
function
computeStyles
(
theme
:
ITheme
,
styleMap
:
IColorMapping
):
IComputedStyles
{
export
function
computeStyles
(
theme
:
ITheme
,
styleMap
:
IColorMapping
):
IComputedStyles
{
...
...
src/vs/platform/theme/common/themeService.ts
浏览文件 @
f7c65e63
...
@@ -52,7 +52,7 @@ export interface ITheme {
...
@@ -52,7 +52,7 @@ export interface ITheme {
* @param color the id of the color
* @param color the id of the color
* @param useDefault specifies if the default color should be used. If not set, the default is used.
* @param useDefault specifies if the default color should be used. If not set, the default is used.
*/
*/
getColor
(
color
:
ColorIdentifier
,
useDefault
?:
boolean
):
Color
|
null
;
getColor
(
color
:
ColorIdentifier
,
useDefault
?:
boolean
):
Color
|
undefined
;
/**
/**
* Returns whether the theme defines a value for the color. If not, that means the
* Returns whether the theme defines a value for the color. If not, that means the
...
...
src/vs/platform/theme/test/common/testThemeService.ts
浏览文件 @
f7c65e63
...
@@ -12,12 +12,12 @@ export class TestTheme implements ITheme {
...
@@ -12,12 +12,12 @@ export class TestTheme implements ITheme {
constructor
(
private
colors
:
{
[
id
:
string
]:
string
;
}
=
{},
public
type
=
DARK
)
{
constructor
(
private
colors
:
{
[
id
:
string
]:
string
;
}
=
{},
public
type
=
DARK
)
{
}
}
getColor
(
color
:
string
,
useDefault
?:
boolean
):
Color
|
null
{
getColor
(
color
:
string
,
useDefault
?:
boolean
):
Color
|
undefined
{
let
value
=
this
.
colors
[
color
];
let
value
=
this
.
colors
[
color
];
if
(
value
)
{
if
(
value
)
{
return
Color
.
fromHex
(
value
);
return
Color
.
fromHex
(
value
);
}
}
return
null
;
return
undefined
;
}
}
defines
(
color
:
string
):
boolean
{
defines
(
color
:
string
):
boolean
{
...
...
src/vs/workbench/browser/parts/quickinput/quickInputBox.ts
浏览文件 @
f7c65e63
...
@@ -100,18 +100,18 @@ export class QuickInputBox {
...
@@ -100,18 +100,18 @@ export class QuickInputBox {
style
(
theme
:
ITheme
)
{
style
(
theme
:
ITheme
)
{
this
.
inputBox
.
style
({
this
.
inputBox
.
style
({
inputForeground
:
theme
.
getColor
(
inputForeground
)
||
undefined
,
inputForeground
:
theme
.
getColor
(
inputForeground
),
inputBackground
:
theme
.
getColor
(
inputBackground
)
||
undefined
,
inputBackground
:
theme
.
getColor
(
inputBackground
),
inputBorder
:
theme
.
getColor
(
inputBorder
)
||
undefined
,
inputBorder
:
theme
.
getColor
(
inputBorder
),
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
)
||
undefined
,
inputValidationInfoBackground
:
theme
.
getColor
(
inputValidationInfoBackground
),
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
)
||
undefined
,
inputValidationInfoForeground
:
theme
.
getColor
(
inputValidationInfoForeground
),
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
)
||
undefined
,
inputValidationInfoBorder
:
theme
.
getColor
(
inputValidationInfoBorder
),
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
)
||
undefined
,
inputValidationWarningBackground
:
theme
.
getColor
(
inputValidationWarningBackground
),
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
)
||
undefined
,
inputValidationWarningForeground
:
theme
.
getColor
(
inputValidationWarningForeground
),
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
)
||
undefined
,
inputValidationWarningBorder
:
theme
.
getColor
(
inputValidationWarningBorder
),
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
)
||
undefined
,
inputValidationErrorBackground
:
theme
.
getColor
(
inputValidationErrorBackground
),
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
)
||
undefined
,
inputValidationErrorForeground
:
theme
.
getColor
(
inputValidationErrorForeground
),
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
)
||
undefined
,
inputValidationErrorBorder
:
theme
.
getColor
(
inputValidationErrorBorder
),
});
});
}
}
...
...
src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts
浏览文件 @
f7c65e63
...
@@ -156,7 +156,7 @@ function getChangeType(change: IChange): ChangeType {
...
@@ -156,7 +156,7 @@ function getChangeType(change: IChange): ChangeType {
}
}
}
}
function
getChangeTypeColor
(
theme
:
ITheme
,
changeType
:
ChangeType
):
Color
|
null
{
function
getChangeTypeColor
(
theme
:
ITheme
,
changeType
:
ChangeType
):
Color
|
undefined
{
switch
(
changeType
)
{
switch
(
changeType
)
{
case
ChangeType
.
Modify
:
return
theme
.
getColor
(
editorGutterModifiedBackground
);
case
ChangeType
.
Modify
:
return
theme
.
getColor
(
editorGutterModifiedBackground
);
case
ChangeType
.
Add
:
return
theme
.
getColor
(
editorGutterAddedBackground
);
case
ChangeType
.
Add
:
return
theme
.
getColor
(
editorGutterAddedBackground
);
...
@@ -365,8 +365,8 @@ class DirtyDiffWidget extends PeekViewWidget {
...
@@ -365,8 +365,8 @@ class DirtyDiffWidget extends PeekViewWidget {
arrowColor
:
borderColor
,
arrowColor
:
borderColor
,
frameColor
:
borderColor
,
frameColor
:
borderColor
,
headerBackgroundColor
:
theme
.
getColor
(
peekViewTitleBackground
)
||
Color
.
transparent
,
headerBackgroundColor
:
theme
.
getColor
(
peekViewTitleBackground
)
||
Color
.
transparent
,
primaryHeadingColor
:
theme
.
getColor
(
peekViewTitleForeground
)
||
undefined
,
primaryHeadingColor
:
theme
.
getColor
(
peekViewTitleForeground
),
secondaryHeadingColor
:
theme
.
getColor
(
peekViewTitleInfoForeground
)
||
undefined
secondaryHeadingColor
:
theme
.
getColor
(
peekViewTitleInfoForeground
)
});
});
}
}
...
...
src/vs/workbench/services/themes/electron-browser/colorThemeData.ts
浏览文件 @
f7c65e63
...
@@ -57,8 +57,8 @@ export class ColorThemeData implements IColorTheme {
...
@@ -57,8 +57,8 @@ export class ColorThemeData implements IColorTheme {
private
colorMap
:
IColorMap
=
{};
private
colorMap
:
IColorMap
=
{};
private
customColorMap
:
IColorMap
=
{};
private
customColorMap
:
IColorMap
=
{};
public
getColor
(
colorId
:
ColorIdentifier
,
useDefault
?:
boolean
):
Color
|
null
{
public
getColor
(
colorId
:
ColorIdentifier
,
useDefault
?:
boolean
):
Color
|
undefined
{
let
color
:
Color
|
null
=
this
.
customColorMap
[
colorId
];
let
color
:
Color
|
undefined
=
this
.
customColorMap
[
colorId
];
if
(
color
)
{
if
(
color
)
{
return
color
;
return
color
;
}
}
...
@@ -69,7 +69,7 @@ export class ColorThemeData implements IColorTheme {
...
@@ -69,7 +69,7 @@ export class ColorThemeData implements IColorTheme {
return
color
;
return
color
;
}
}
public
getDefault
(
colorId
:
ColorIdentifier
):
Color
|
null
{
public
getDefault
(
colorId
:
ColorIdentifier
):
Color
|
undefined
{
return
colorRegistry
.
resolveDefaultColor
(
colorId
,
this
);
return
colorRegistry
.
resolveDefaultColor
(
colorId
,
this
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录