Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
7bf2e475
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,发现更多精彩内容 >>
提交
7bf2e475
编写于
6月 12, 2020
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Proper fix #86192
上级
5711fadd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
52 addition
and
36 deletion
+52
-36
src/vs/workbench/contrib/extensions/browser/extensionsList.ts
...vs/workbench/contrib/extensions/browser/extensionsList.ts
+52
-31
src/vs/workbench/contrib/extensions/browser/media/extensionsViewlet.css
...ch/contrib/extensions/browser/media/extensionsViewlet.css
+0
-5
未找到文件。
src/vs/workbench/contrib/extensions/browser/extensionsList.ts
浏览文件 @
7bf2e475
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
'
vs/css!./media/extension
'
;
import
{
append
,
$
,
addClass
,
removeClass
}
from
'
vs/base/browser/dom
'
;
import
{
append
,
$
,
addClass
,
removeClass
,
toggleClass
}
from
'
vs/base/browser/dom
'
;
import
{
IDisposable
,
dispose
,
combinedDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
...
...
@@ -21,8 +21,8 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
import
{
IExtensionManagementServerService
}
from
'
vs/workbench/services/extensionManagement/common/extensionManagement
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
isLanguagePackExtension
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
foreground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
registerThemingParticipant
,
IColorTheme
,
ICssStyleCollector
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
foreground
,
listActiveSelectionForeground
,
listActiveSelectionBackground
,
listInactiveSelectionForeground
,
listInactiveSelectionBackground
,
listFocusForeground
,
listFocusBackground
,
listHoverForeground
,
listHoverBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
WORKBENCH_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
export
interface
IExtensionsViewState
{
...
...
@@ -61,7 +61,6 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
@
IExtensionService
private
readonly
extensionService
:
IExtensionService
,
@
IExtensionManagementServerService
private
readonly
extensionManagementServerService
:
IExtensionManagementServerService
,
@
IExtensionsWorkbenchService
private
readonly
extensionsWorkbenchService
:
IExtensionsWorkbenchService
,
@
IThemeService
private
readonly
themeService
:
IThemeService
,
)
{
}
get
templateId
()
{
return
'
extension
'
;
}
...
...
@@ -167,23 +166,10 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
const
runningExtension
=
runningExtensions
.
filter
(
e
=>
areSameExtensions
({
id
:
e
.
identifier
.
value
,
uuid
:
e
.
uuid
},
extension
.
identifier
))[
0
];
isDisabled
=
!
(
runningExtension
&&
extension
.
server
===
this
.
extensionManagementServerService
.
getExtensionManagementServer
(
runningExtension
.
extensionLocation
));
}
};
const
updateStyles
=
()
=>
{
data
.
author
.
style
.
color
=
''
;
data
.
root
.
style
.
color
=
''
;
if
(
isDisabled
)
{
addClass
(
data
.
root
,
'
disabled
'
);
data
.
root
.
style
.
color
=
this
.
getDisabledForeground
();
}
else
{
removeClass
(
data
.
root
,
'
disabled
'
);
data
.
author
.
style
.
color
=
this
.
getAuthorForeground
();
}
toggleClass
(
data
.
root
,
'
disabled
'
,
isDisabled
);
};
updateEnablement
().
then
(()
=>
updateStyles
());
this
.
extensionService
.
onDidChangeExtensions
(()
=>
updateEnablement
().
then
(()
=>
updateStyles
()),
this
,
data
.
extensionDisposables
);
this
.
themeService
.
onDidColorThemeChange
(()
=>
updateStyles
(),
this
,
data
.
extensionDisposables
);
updateEnablement
();
this
.
extensionService
.
onDidChangeExtensions
(()
=>
updateEnablement
(),
this
,
data
.
extensionDisposables
);
const
onError
=
Event
.
once
(
domEvent
(
data
.
icon
,
'
error
'
));
onError
(()
=>
data
.
icon
.
src
=
extension
.
iconUrlFallback
,
null
,
data
.
extensionDisposables
);
...
...
@@ -221,19 +207,54 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
}
private
getAuthorForeground
():
string
{
const
colorTheme
=
this
.
themeService
.
getColorTheme
();
const
foregroundColor
=
colorTheme
.
getColor
(
foreground
);
return
foregroundColor
?
foregroundColor
.
transparent
(.
9
).
makeOpaque
(
WORKBENCH_BACKGROUND
(
colorTheme
)).
toString
()
:
''
;
disposeTemplate
(
data
:
ITemplateData
):
void
{
data
.
disposables
=
dispose
(
data
.
disposables
);
}
}
private
getDisabledForeground
():
string
{
const
colorTheme
=
this
.
themeService
.
getColorTheme
();
const
foregroundColor
=
colorTheme
.
getColor
(
foreground
);
return
foregroundColor
?
foregroundColor
.
transparent
(.
5
).
makeOpaque
(
WORKBENCH_BACKGROUND
(
colorTheme
)).
toString
()
:
''
;
registerThemingParticipant
((
theme
:
IColorTheme
,
collector
:
ICssStyleCollector
)
=>
{
const
foregroundColor
=
theme
.
getColor
(
foreground
);
if
(
foregroundColor
)
{
const
authorForeground
=
foregroundColor
.
transparent
(.
9
).
makeOpaque
(
WORKBENCH_BACKGROUND
(
theme
));
collector
.
addRule
(
`.extensions-list .monaco-list .monaco-list-row:not(.disabled) .author { color:
${
authorForeground
}
; }`
);
const
disabledExtensionForeground
=
foregroundColor
.
transparent
(.
5
).
makeOpaque
(
WORKBENCH_BACKGROUND
(
theme
));
collector
.
addRule
(
`.extensions-list .monaco-list .monaco-list-row.disabled { color:
${
disabledExtensionForeground
}
; }`
);
}
disposeTemplate
(
data
:
ITemplateData
):
void
{
data
.
disposables
=
dispose
(
data
.
disposables
);
const
listActiveSelectionForegroundColor
=
theme
.
getColor
(
listActiveSelectionForeground
);
const
listActiveSelectionBackgroundColor
=
theme
.
getColor
(
listActiveSelectionBackground
);
if
(
listActiveSelectionForegroundColor
&&
listActiveSelectionBackgroundColor
)
{
const
authorForeground
=
listActiveSelectionForegroundColor
.
transparent
(.
9
).
makeOpaque
(
listActiveSelectionBackgroundColor
);
collector
.
addRule
(
`.extensions-list .monaco-list:focus .monaco-list-row:not(.disabled).selected.focused .author { color:
${
authorForeground
}
; }`
);
const
disabledExtensionForeground
=
listActiveSelectionForegroundColor
.
transparent
(.
5
).
makeOpaque
(
listActiveSelectionBackgroundColor
);
collector
.
addRule
(
`.extensions-list .monaco-list:focus .monaco-list-row.disabled.selected.focused { color:
${
disabledExtensionForeground
}
; }`
);
}
}
const
listInactiveSelectionForegroundColor
=
theme
.
getColor
(
listInactiveSelectionForeground
);
const
listInactiveSelectionBackgroundColor
=
theme
.
getColor
(
listInactiveSelectionBackground
);
if
(
listInactiveSelectionForegroundColor
&&
listInactiveSelectionBackgroundColor
)
{
const
authorForeground
=
listInactiveSelectionForegroundColor
.
transparent
(.
9
).
makeOpaque
(
listInactiveSelectionBackgroundColor
);
collector
.
addRule
(
`.extensions-list .monaco-list .monaco-list-row:not(.disabled).selected.focused .author { color:
${
authorForeground
}
; }`
);
const
disabledExtensionForeground
=
listInactiveSelectionForegroundColor
.
transparent
(.
5
).
makeOpaque
(
listInactiveSelectionBackgroundColor
);
collector
.
addRule
(
`.extensions-list .monaco-list .monaco-list-row.disabled.selected.focused { color:
${
disabledExtensionForeground
}
; }`
);
}
const
listFocusForegroundColor
=
theme
.
getColor
(
listFocusForeground
);
const
listFocusBackgroundColor
=
theme
.
getColor
(
listFocusBackground
);
if
(
listFocusForegroundColor
&&
listFocusBackgroundColor
)
{
const
authorForeground
=
listFocusForegroundColor
.
transparent
(.
9
).
makeOpaque
(
listFocusBackgroundColor
);
collector
.
addRule
(
`.extensions-list .monaco-list:focus .monaco-list-row:not(.disabled).focused .author { color:
${
authorForeground
}
; }`
);
const
disabledExtensionForeground
=
listFocusForegroundColor
.
transparent
(.
5
).
makeOpaque
(
listFocusBackgroundColor
);
collector
.
addRule
(
`.extensions-list .monaco-list:focus .monaco-list-row.disabled.focused { color:
${
disabledExtensionForeground
}
; }`
);
}
const
listHoverForegroundColor
=
theme
.
getColor
(
listHoverForeground
);
const
listHoverBackgroundColor
=
theme
.
getColor
(
listHoverBackground
);
if
(
listHoverForegroundColor
&&
listHoverBackgroundColor
)
{
const
authorForeground
=
listHoverForegroundColor
.
transparent
(.
9
).
makeOpaque
(
listHoverBackgroundColor
);
collector
.
addRule
(
`.extensions-list .monaco-list .monaco-list-row:hover:not(.disabled):not(.selected):.not(.focused) .author { color:
${
authorForeground
}
; }`
);
const
disabledExtensionForeground
=
listHoverForegroundColor
.
transparent
(.
5
).
makeOpaque
(
listHoverBackgroundColor
);
collector
.
addRule
(
`.extensions-list .monaco-list .monaco-list-row.disabled:hover:not(.selected):.not(.focused) { color:
${
disabledExtensionForeground
}
; }`
);
}
});
src/vs/workbench/contrib/extensions/browser/media/extensionsViewlet.css
浏览文件 @
7bf2e475
...
...
@@ -103,11 +103,6 @@
display
:
none
;
}
.extensions-viewlet
>
.extensions
.selected
.extension-list-item
>
.details
>
.footer
>
.author
,
.extensions-viewlet
>
.extensions
.selected.focused
.extension-list-item
>
.details
>
.footer
>
.author
{
opacity
:
1
;
}
.extensions-viewlet.narrow
>
.extensions
.extension-list-item
>
.details
>
.footer
>
.monaco-action-bar
>
.actions-container
.extension-action
{
max-width
:
100px
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录