Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f91c7ded
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f91c7ded
编写于
3月 06, 2020
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
product icons more
上级
18f3bee3
变更
10
展开全部
显示空白变更内容
内联
并排
Showing
10 changed file
with
3161 addition
and
55 deletion
+3161
-55
extensions/extension-editing/package.json
extensions/extension-editing/package.json
+5
-1
extensions/vscode-colorize-tests/package.json
extensions/vscode-colorize-tests/package.json
+7
-0
extensions/vscode-colorize-tests/producticons/ElegantIcons.woff
...ions/vscode-colorize-tests/producticons/ElegantIcons.woff
+0
-0
extensions/vscode-colorize-tests/producticons/index.html
extensions/vscode-colorize-tests/producticons/index.html
+3049
-0
extensions/vscode-colorize-tests/producticons/mit_license.txt
...nsions/vscode-colorize-tests/producticons/mit_license.txt
+21
-0
extensions/vscode-colorize-tests/producticons/test-product-icon-theme.json
...-colorize-tests/producticons/test-product-icon-theme.json
+36
-0
src/vs/workbench/services/themes/browser/fileIconThemeData.ts
...vs/workbench/services/themes/browser/fileIconThemeData.ts
+1
-1
src/vs/workbench/services/themes/browser/productIconThemeData.ts
...workbench/services/themes/browser/productIconThemeData.ts
+1
-1
src/vs/workbench/services/themes/browser/workbenchThemeService.ts
...orkbench/services/themes/browser/workbenchThemeService.ts
+11
-27
src/vs/workbench/services/themes/common/themeExtensionPoints.ts
.../workbench/services/themes/common/themeExtensionPoints.ts
+30
-25
未找到文件。
extensions/extension-editing/package.json
浏览文件 @
f91c7ded
...
...
@@ -35,9 +35,13 @@
"url"
:
"vscode://schemas/language-configuration"
},
{
"fileMatch"
:
"*icon-theme.json"
,
"fileMatch"
:
[
"*icon-theme.json"
,
"!*product-icon-theme.json"
]
,
"url"
:
"vscode://schemas/icon-theme"
},
{
"fileMatch"
:
"*product-icon-theme.json"
,
"url"
:
"vscode://schemas/product-icon-theme"
},
{
"fileMatch"
:
"*color-theme.json"
,
"url"
:
"vscode://schemas/color-theme"
...
...
extensions/vscode-colorize-tests/package.json
浏览文件 @
f91c7ded
...
...
@@ -55,6 +55,13 @@
"fontStyle"
:
"bold"
}
}
],
"productIconThemes"
:
[
{
"id"
:
"Test Product Icons"
,
"label"
:
"The Test Product Icon Theme"
,
"path"
:
"./producticons/test-product-icon-theme.json"
}
]
}
}
extensions/vscode-colorize-tests/producticons/ElegantIcons.woff
0 → 100644
浏览文件 @
f91c7ded
文件已添加
extensions/vscode-colorize-tests/producticons/index.html
0 → 100644
浏览文件 @
f91c7ded
此差异已折叠。
点击以展开。
extensions/vscode-colorize-tests/producticons/mit_license.txt
0 → 100644
浏览文件 @
f91c7ded
The MIT License (MIT)
Copyright (c) <2013> <Elegant Themes, Inc.>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
\ No newline at end of file
extensions/vscode-colorize-tests/producticons/test-product-icon-theme.json
0 → 100644
浏览文件 @
f91c7ded
{
//
ElegantIcons
from
https://www.elegantthemes.com/icons/elegant_font.zip
"fonts"
:
[
{
"id"
:
"elegant"
,
"src"
:
[
{
"path"
:
"./ElegantIcons.woff"
,
"format"
:
"woff"
}
],
"weight"
:
"normal"
,
"style"
:
"normal"
,
}
],
"iconDefinitions"
:
{
"chevron-down"
:
{
"fontCharacter"
:
"
\\
43"
,
},
"chevron-right"
:
{
"fontCharacter"
:
"
\\
45"
},
"error"
:
{
"fontCharacter"
:
"
\\
e062"
},
"warning"
:
{
"fontCharacter"
:
"
\\
e063"
},
"settings-gear"
:
{
"fontCharacter"
:
"
\\
e035"
},
"settings-files"
:
{
"fontCharacter"
:
"
\\
e006;"
}
}
}
src/vs/workbench/services/themes/browser/fileIconThemeData.ts
浏览文件 @
f91c7ded
...
...
@@ -81,7 +81,7 @@ export class FileIconThemeData implements IWorkbenchFileIconTheme {
private
static
_noIconTheme
:
FileIconThemeData
|
null
=
null
;
static
noIconTheme
():
FileIconThemeData
{
static
get
noIconTheme
():
FileIconThemeData
{
let
themeData
=
FileIconThemeData
.
_noIconTheme
;
if
(
!
themeData
)
{
themeData
=
FileIconThemeData
.
_noIconTheme
=
new
FileIconThemeData
(
''
,
''
,
null
);
...
...
src/vs/workbench/services/themes/browser/productIconThemeData.ts
浏览文件 @
f91c7ded
...
...
@@ -83,7 +83,7 @@ export class ProductIconThemeData implements IWorkbenchProductIconTheme {
private
static
_defaultProductIconTheme
:
ProductIconThemeData
|
null
=
null
;
static
defaultTheme
():
ProductIconThemeData
{
static
get
defaultTheme
():
ProductIconThemeData
{
let
themeData
=
ProductIconThemeData
.
_defaultProductIconTheme
;
if
(
!
themeData
)
{
themeData
=
ProductIconThemeData
.
_defaultProductIconTheme
=
new
ProductIconThemeData
(
DEFAULT_PRODUCT_ICON_THEME_ID
,
nls
.
localize
(
'
defaultTheme
'
,
'
Default theme
'
),
DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE
);
...
...
src/vs/workbench/services/themes/browser/workbenchThemeService.ts
浏览文件 @
f91c7ded
...
...
@@ -29,7 +29,7 @@ import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts';
import
{
IWorkbenchLayoutService
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
IExtensionResourceLoaderService
}
from
'
vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader
'
;
import
{
ThemeRegistry
,
registerColorThemeExtensionPoint
,
registerFileIconThemeExtensionPoint
,
registerProductIconThemeExtensionPoint
}
from
'
vs/workbench/services/themes/common/themeExtensionPoints
'
;
import
{
updateColorThemeConfigurationSchemas
,
updateFileIconThemeConfigurationSchemas
,
ThemeConfiguration
,
updateProductIconThemeConfigurationSchemas
}
from
'
vs/workbench/services/themes/common/themeConfiguration
'
;
import
{
updateColorThemeConfigurationSchemas
,
updateFileIconThemeConfigurationSchemas
,
ThemeConfiguration
,
updateProductIconThemeConfigurationSchemas
,
DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE
}
from
'
vs/workbench/services/themes/common/themeConfiguration
'
;
import
{
ProductIconThemeData
,
DEFAULT_PRODUCT_ICON_THEME_ID
}
from
'
vs/workbench/services/themes/browser/productIconThemeData
'
;
import
{
registerProductIconThemeSchemas
}
from
'
vs/workbench/services/themes/common/productIconThemeSchema
'
;
...
...
@@ -108,12 +108,12 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
this
.
currentColorTheme
=
ColorThemeData
.
createUnloadedTheme
(
''
);
this
.
fileIconThemeWatcher
=
new
ThemeFileWatcher
(
fileService
,
environmentService
,
this
.
reloadCurrentFileIconTheme
.
bind
(
this
));
this
.
fileIconThemeRegistry
=
new
ThemeRegistry
(
extensionService
,
fileIconThemesExtPoint
,
FileIconThemeData
.
fromExtensionTheme
,
true
);
this
.
fileIconThemeRegistry
=
new
ThemeRegistry
(
extensionService
,
fileIconThemesExtPoint
,
FileIconThemeData
.
fromExtensionTheme
,
true
,
FileIconThemeData
.
noIconTheme
);
this
.
onFileIconThemeChange
=
new
Emitter
<
IWorkbenchFileIconTheme
>
();
this
.
currentFileIconTheme
=
FileIconThemeData
.
createUnloadedTheme
(
''
);
this
.
productIconThemeWatcher
=
new
ThemeFileWatcher
(
fileService
,
environmentService
,
this
.
reloadCurrentProductIconTheme
.
bind
(
this
));
this
.
productIconThemeRegistry
=
new
ThemeRegistry
(
extensionService
,
productIconThemesExtPoint
,
ProductIconThemeData
.
fromExtensionTheme
,
true
);
this
.
productIconThemeRegistry
=
new
ThemeRegistry
(
extensionService
,
productIconThemesExtPoint
,
ProductIconThemeData
.
fromExtensionTheme
,
true
,
ProductIconThemeData
.
defaultTheme
);
this
.
onProductIconThemeChange
=
new
Emitter
<
IWorkbenchProductIconTheme
>
();
this
.
currentProductIconTheme
=
ProductIconThemeData
.
createUnloadedTheme
(
''
);
...
...
@@ -187,7 +187,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
if
(
!
await
this
.
restoreFileIconTheme
())
{
// checks if theme from settings exists and is set
// restore theme
if
(
this
.
currentFileIconTheme
.
id
===
DEFAULT_FILE_ICON_THEME_ID
&&
!
types
.
isUndefined
(
prevFileIconId
)
&&
await
this
.
fi
ndFileIcon
ThemeById
(
prevFileIconId
))
{
if
(
this
.
currentFileIconTheme
.
id
===
DEFAULT_FILE_ICON_THEME_ID
&&
!
types
.
isUndefined
(
prevFileIconId
)
&&
await
this
.
fi
leIconThemeRegistry
.
find
ThemeById
(
prevFileIconId
))
{
this
.
setFileIconTheme
(
prevFileIconId
,
'
auto
'
);
prevFileIconId
=
undefined
;
}
else
{
...
...
@@ -206,7 +206,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
if
(
await
this
.
restoreProductIconTheme
())
{
// checks if theme from settings exists and is set
// restore theme
if
(
this
.
currentProductIconTheme
.
id
===
DEFAULT_PRODUCT_ICON_THEME_ID
&&
!
types
.
isUndefined
(
prevProductIconId
)
&&
await
this
.
findProductIcon
ThemeById
(
prevProductIconId
))
{
if
(
this
.
currentProductIconTheme
.
id
===
DEFAULT_PRODUCT_ICON_THEME_ID
&&
!
types
.
isUndefined
(
prevProductIconId
)
&&
await
this
.
productIconThemeRegistry
.
find
ThemeById
(
prevProductIconId
))
{
this
.
setProductIconTheme
(
prevProductIconId
,
'
auto
'
);
prevProductIconId
=
undefined
;
}
else
{
...
...
@@ -256,7 +256,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
if
(
devThemes
.
length
)
{
return
this
.
setFileIconTheme
(
devThemes
[
0
].
id
,
ConfigurationTarget
.
MEMORY
);
}
const
theme
=
await
this
.
fi
ndFileIcon
ThemeBySettingsId
(
this
.
settings
.
fileIconTheme
);
const
theme
=
await
this
.
fi
leIconThemeRegistry
.
find
ThemeBySettingsId
(
this
.
settings
.
fileIconTheme
);
return
this
.
setFileIconTheme
(
theme
?
theme
.
id
:
DEFAULT_FILE_ICON_THEME_ID
,
undefined
);
};
...
...
@@ -265,7 +265,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
if
(
devThemes
.
length
)
{
return
this
.
setProductIconTheme
(
devThemes
[
0
].
id
,
ConfigurationTarget
.
MEMORY
);
}
const
theme
=
await
this
.
findProductIcon
ThemeBySettingsId
(
this
.
settings
.
productIconTheme
);
const
theme
=
await
this
.
productIconThemeRegistry
.
find
ThemeBySettingsId
(
this
.
settings
.
productIconTheme
);
return
this
.
setProductIconTheme
(
theme
?
theme
.
id
:
DEFAULT_PRODUCT_ICON_THEME_ID
,
undefined
);
};
...
...
@@ -514,7 +514,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
return
this
.
currentFileIconTheme
;
}
const
newThemeData
=
(
await
this
.
fi
ndFileIconThemeById
(
iconTheme
))
||
FileIconThemeData
.
noIconTheme
()
;
const
newThemeData
=
(
await
this
.
fi
leIconThemeRegistry
.
findThemeById
(
iconTheme
))
||
FileIconThemeData
.
noIconTheme
;
await
newThemeData
.
ensureLoaded
(
this
.
fileService
);
_applyRules
(
newThemeData
.
styleSheetContent
!
,
fileIconThemeRulesClassName
);
...
...
@@ -529,14 +529,6 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
return
newThemeData
;
}
private
async
findFileIconThemeById
(
id
:
string
):
Promise
<
FileIconThemeData
|
undefined
>
{
return
id
.
length
===
0
?
FileIconThemeData
.
noIconTheme
()
:
this
.
fileIconThemeRegistry
.
findThemeById
(
id
);
}
private
async
findFileIconThemeBySettingsId
(
settingsId
:
string
|
null
):
Promise
<
FileIconThemeData
|
undefined
>
{
return
!
settingsId
?
FileIconThemeData
.
noIconTheme
()
:
this
.
fileIconThemeRegistry
.
findThemeBySettingsId
(
settingsId
);
}
private
async
reloadCurrentFileIconTheme
()
{
await
this
.
currentFileIconTheme
.
reload
(
this
.
fileService
);
_applyRules
(
this
.
currentFileIconTheme
.
styleSheetContent
!
,
fileIconThemeRulesClassName
);
...
...
@@ -545,7 +537,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
public
async
restoreFileIconTheme
():
Promise
<
boolean
>
{
const
settingId
=
this
.
settings
.
fileIconTheme
;
const
theme
=
await
this
.
fi
ndFileIcon
ThemeBySettingsId
(
settingId
);
const
theme
=
await
this
.
fi
leIconThemeRegistry
.
find
ThemeBySettingsId
(
settingId
);
if
(
theme
)
{
if
(
settingId
!==
this
.
currentFileIconTheme
.
settingsId
)
{
await
this
.
setFileIconTheme
(
theme
.
id
,
undefined
);
...
...
@@ -588,7 +580,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
return
this
.
currentProductIconTheme
;
}
const
newThemeData
=
await
this
.
findProductIconThemeById
(
iconTheme
)
||
ProductIconThemeData
.
defaultTheme
()
;
const
newThemeData
=
await
this
.
productIconThemeRegistry
.
findThemeById
(
iconTheme
)
||
ProductIconThemeData
.
defaultTheme
;
await
newThemeData
.
ensureLoaded
(
this
.
fileService
);
_applyRules
(
newThemeData
.
styleSheetContent
!
,
fileIconThemeRulesClassName
);
...
...
@@ -603,14 +595,6 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
return
newThemeData
;
}
private
async
findProductIconThemeById
(
id
:
string
):
Promise
<
ProductIconThemeData
|
undefined
>
{
return
id
.
length
===
0
?
ProductIconThemeData
.
defaultTheme
()
:
this
.
productIconThemeRegistry
.
findThemeById
(
id
);
}
private
async
findProductIconThemeBySettingsId
(
settingsId
:
string
|
null
):
Promise
<
ProductIconThemeData
|
undefined
>
{
return
!
settingsId
?
ProductIconThemeData
.
defaultTheme
()
:
this
.
productIconThemeRegistry
.
findThemeBySettingsId
(
settingsId
);
}
private
async
reloadCurrentProductIconTheme
()
{
await
this
.
currentProductIconTheme
.
reload
(
this
.
fileService
);
_applyRules
(
this
.
currentProductIconTheme
.
styleSheetContent
!
,
productIconThemeRulesClassName
);
...
...
@@ -619,7 +603,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
public
async
restoreProductIconTheme
():
Promise
<
boolean
>
{
const
settingId
=
this
.
settings
.
productIconTheme
;
const
theme
=
await
this
.
findProductIcon
ThemeBySettingsId
(
settingId
);
const
theme
=
await
this
.
productIconThemeRegistry
.
find
ThemeBySettingsId
(
settingId
);
if
(
theme
)
{
if
(
settingId
!==
this
.
currentProductIconTheme
.
settingsId
)
{
await
this
.
setProductIconTheme
(
theme
.
id
,
undefined
);
...
...
src/vs/workbench/services/themes/common/themeExtensionPoints.ts
浏览文件 @
f91c7ded
...
...
@@ -126,7 +126,8 @@ export class ThemeRegistry<T extends IThemeData> {
@
IExtensionService
private
readonly
extensionService
:
IExtensionService
,
private
readonly
themesExtPoint
:
IExtensionPoint
<
IThemeExtensionPoint
[]
>
,
private
create
:
(
theme
:
IThemeExtensionPoint
,
themeLocation
:
URI
,
extensionData
:
ExtensionData
)
=>
T
,
private
idRequired
=
false
private
idRequired
=
false
,
private
builtInTheme
:
T
|
undefined
=
undefined
)
{
this
.
extensionThemes
=
[];
this
.
initialize
();
...
...
@@ -198,8 +199,11 @@ export class ThemeRegistry<T extends IThemeData> {
});
}
public
findThemeById
(
themeId
:
string
,
defaultId
?:
string
):
Promise
<
T
|
undefined
>
{
return
this
.
getThemes
().
then
(
allThemes
=>
{
public
async
findThemeById
(
themeId
:
string
,
defaultId
?:
string
):
Promise
<
T
|
undefined
>
{
if
(
this
.
builtInTheme
&&
this
.
builtInTheme
.
id
===
themeId
)
{
return
this
.
builtInTheme
;
}
const
allThemes
=
await
this
.
getThemes
();
let
defaultTheme
:
T
|
undefined
=
undefined
;
for
(
let
t
of
allThemes
)
{
if
(
t
.
id
===
themeId
)
{
...
...
@@ -210,11 +214,13 @@ export class ThemeRegistry<T extends IThemeData> {
}
}
return
defaultTheme
;
});
}
public
findThemeBySettingsId
(
settingsId
:
string
|
null
,
defaultId
?:
string
):
Promise
<
T
|
undefined
>
{
return
this
.
getThemes
().
then
(
allThemes
=>
{
public
async
findThemeBySettingsId
(
settingsId
:
string
|
null
,
defaultId
?:
string
):
Promise
<
T
|
undefined
>
{
if
(
this
.
builtInTheme
&&
this
.
builtInTheme
.
settingsId
===
settingsId
)
{
return
this
.
builtInTheme
;
}
const
allThemes
=
await
this
.
getThemes
();
let
defaultTheme
:
T
|
undefined
=
undefined
;
for
(
let
t
of
allThemes
)
{
if
(
t
.
settingsId
===
settingsId
)
{
...
...
@@ -225,7 +231,6 @@ export class ThemeRegistry<T extends IThemeData> {
}
}
return
defaultTheme
;
});
}
public
findThemeByExtensionLocation
(
extLocation
:
URI
|
undefined
):
Promise
<
T
[]
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录