Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
48968ba1
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,发现更多精彩内容 >>
提交
48968ba1
编写于
5月 24, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
theming: extension buttons
上级
04d5fc77
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
62 addition
and
63 deletion
+62
-63
src/vs/workbench/parts/extensions/browser/extensionsActions.ts
...s/workbench/parts/extensions/browser/extensionsActions.ts
+62
-4
src/vs/workbench/parts/extensions/browser/media/extensionActions.css
...bench/parts/extensions/browser/media/extensionActions.css
+0
-59
未找到文件。
src/vs/workbench/parts/extensions/browser/extensionsActions.ts
浏览文件 @
48968ba1
...
...
@@ -32,13 +32,16 @@ import { IExtensionService, IExtensionDescription } from 'vs/platform/extensions
import
URI
from
'
vs/base/common/uri
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
registerThemingParticipant
,
ITheme
,
ICssStyleCollector
}
from
"
vs/platform/theme/common/themeService
"
;
import
{
buttonBackground
,
buttonForeground
,
buttonHoverBackground
,
contrastBorder
,
registerColor
}
from
"
vs/platform/theme/common/colorRegistry
"
;
import
{
Color
}
from
"
vs/base/common/color
"
;
export
class
InstallAction
extends
Action
{
private
static
InstallLabel
=
localize
(
'
installAction
'
,
"
Install
"
);
private
static
InstallingLabel
=
localize
(
'
installing
'
,
"
Installing
"
);
private
static
Class
=
'
extension-action install
'
;
private
static
Class
=
'
extension-action
prominent
install
'
;
private
static
InstallingClass
=
'
extension-action install installing
'
;
private
disposables
:
IDisposable
[]
=
[];
...
...
@@ -153,7 +156,7 @@ export class UninstallAction extends Action {
export
class
CombinedInstallAction
extends
Action
{
private
static
NoExtensionClass
=
'
extension-action install no-extension
'
;
private
static
NoExtensionClass
=
'
extension-action
prominent
install no-extension
'
;
private
installAction
:
InstallAction
;
private
uninstallAction
:
UninstallAction
;
private
disposables
:
IDisposable
[]
=
[];
...
...
@@ -224,7 +227,7 @@ export class CombinedInstallAction extends Action {
export
class
UpdateAction
extends
Action
{
private
static
EnabledClass
=
'
extension-action update
'
;
private
static
EnabledClass
=
'
extension-action
prominent
update
'
;
private
static
DisabledClass
=
`
${
UpdateAction
.
EnabledClass
}
disabled`
;
private
static
Label
=
localize
(
'
updateAction
'
,
"
Update
"
);
...
...
@@ -477,7 +480,7 @@ export class EnableGloballyAction extends Action implements IExtensionAction {
export
class
EnableAction
extends
Action
{
static
ID
=
'
extensions.enable
'
;
private
static
EnabledClass
=
'
extension-action enable
'
;
private
static
EnabledClass
=
'
extension-action
prominent
enable
'
;
private
static
DisabledClass
=
`
${
EnableAction
.
EnabledClass
}
disabled`
;
private
disposables
:
IDisposable
[]
=
[];
...
...
@@ -1385,3 +1388,58 @@ CommandsRegistry.registerCommand('workbench.extensions.action.showLanguageExtens
viewlet
.
focus
();
});
});
export
const
extensionButtonProminentBackground
=
registerColor
(
'
extensionButton.prominentBackground
'
,
{
dark
:
'
#327e36
'
,
light
:
'
#327e36
'
,
hc
:
null
},
localize
(
'
extensionButtonProminentBackground
'
,
"
Button background color for actions extension that stand out (e.g. install button).
"
));
export
const
extensionButtonProminentForeground
=
registerColor
(
'
extensionButton.prominentForeground
'
,
{
dark
:
Color
.
white
,
light
:
Color
.
white
,
hc
:
null
},
localize
(
'
extensionButtonProminentForeground
'
,
"
Button foreground color for actions extension that stand out (e.g. install button).
"
));
export
const
extensionButtonProminentHoverBackground
=
registerColor
(
'
extensionButton.prominentHoverBackground
'
,
{
dark
:
'
#28632b
'
,
light
:
'
#28632b
'
,
hc
:
null
},
localize
(
'
extensionButtonProminentHoverBackground
'
,
"
Button background hover color for actions extension that stand out (e.g. install button).
"
));
registerThemingParticipant
((
theme
:
ITheme
,
collector
:
ICssStyleCollector
)
=>
{
const
buttonBackgroundColor
=
theme
.
getColor
(
buttonBackground
);
if
(
buttonBackgroundColor
)
{
collector
.
addRule
(
`.monaco-action-bar .action-item .action-label.extension-action { background-color:
${
buttonBackgroundColor
}
; }`
);
}
const
buttonForegroundColor
=
theme
.
getColor
(
buttonForeground
);
if
(
buttonForegroundColor
)
{
collector
.
addRule
(
`.monaco-action-bar .action-item .action-label.extension-action { color:
${
buttonForegroundColor
}
; }`
);
}
const
buttonHoverBackgroundColor
=
theme
.
getColor
(
buttonHoverBackground
);
if
(
buttonHoverBackgroundColor
)
{
collector
.
addRule
(
`.monaco-action-bar .action-item:hover .action-label.extension-action { background-color:
${
buttonHoverBackgroundColor
}
; }`
);
}
const
contrastBorderColor
=
theme
.
getColor
(
contrastBorder
);
if
(
contrastBorderColor
)
{
collector
.
addRule
(
`.monaco-action-bar .action-item .action-label.extension-action { border: 1px solid
${
contrastBorderColor
}
; }`
);
}
const
extensionButtonProminentBackgroundColor
=
theme
.
getColor
(
extensionButtonProminentBackground
);
if
(
extensionButtonProminentBackground
)
{
collector
.
addRule
(
`.monaco-action-bar .action-item .action-label.extension-action.prominent { background-color:
${
extensionButtonProminentBackgroundColor
}
; }`
);
}
const
extensionButtonProminentForegroundColor
=
theme
.
getColor
(
extensionButtonProminentForeground
);
if
(
extensionButtonProminentForeground
)
{
collector
.
addRule
(
`.monaco-action-bar .action-item .action-label.extension-action.prominent { color:
${
extensionButtonProminentForegroundColor
}
; }`
);
}
const
extensionButtonProminentHoverBackgroundColor
=
theme
.
getColor
(
extensionButtonProminentHoverBackground
);
if
(
extensionButtonProminentHoverBackground
)
{
collector
.
addRule
(
`.monaco-action-bar .action-item:hover .action-label.extension-action.prominent { background-color:
${
extensionButtonProminentHoverBackgroundColor
}
; }`
);
}
});
\ No newline at end of file
src/vs/workbench/parts/extensions/browser/media/extensionActions.css
浏览文件 @
48968ba1
...
...
@@ -4,69 +4,10 @@
*--------------------------------------------------------------------------------------------*/
.monaco-action-bar
.action-item
.action-label.extension-action
{
border
:
1px
solid
#CCC
;
color
:
#6C6C6C
;
background-color
:
#E2E2E2
;
padding
:
0
5px
;
line-height
:
initial
;
}
.monaco-action-bar
.action-item
:not
(
.disabled
)
:hover
.action-label.extension-action
{
background-color
:
#D9D9D9
;
}
.monaco-action-bar
.action-item
:not
(
.disabled
)
:active
.action-label.extension-action
{
background-color
:
#C9C9C9
;
}
.vs-dark
.monaco-action-bar
.action-item
.action-label.extension-action
{
border
:
1px
solid
#545454
;
color
:
#CCC
;
background-color
:
#3A3A3A
;
}
.vs-dark
.monaco-action-bar
.action-item
:not
(
.disabled
)
:hover
.action-label.extension-action
{
background-color
:
#464646
;
}
.vs-dark
.monaco-action-bar
.action-item
:not
(
.disabled
)
:active
.action-label.extension-action
{
background-color
:
#505050
;
}
.monaco-action-bar
.action-item
.action-label.extension-action.install
,
.monaco-action-bar
.action-item
.action-label.extension-action.enable
,
.monaco-action-bar
.action-item
.action-label.extension-action.update
{
color
:
white
;
background-color
:
#327e36
;
border-color
:
#519A55
;
}
.monaco-action-bar
.action-item
:not
(
.disabled
)
:hover
.action-label.extension-action.install
,
.monaco-action-bar
.action-item
:not
(
.disabled
)
:hover
.action-label.extension-action.enable
,
.monaco-action-bar
.action-item
:not
(
.disabled
)
:hover
.action-label.extension-action.update
{
background-color
:
#478E4B
;
}
.monaco-action-bar
.action-item
:not
(
.disabled
)
:active
.action-label.extension-action.install
,
.monaco-action-bar
.action-item
:not
(
.disabled
)
:active
.action-label.extension-action.enable
,
.monaco-action-bar
.action-item
:not
(
.disabled
)
:active
.action-label.extension-action.update
{
background-color
:
#6DA770
;
}
.monaco-action-bar
.action-item
.action-label.extension-action.reload
{
color
:
white
;
background-color
:
#007ACC
;
border-color
:
#3F8BCE
;
}
.monaco-action-bar
.action-item
:not
(
.disabled
)
:hover
.action-label.extension-action.reload
{
background-color
:
#2584C4
;
}
.monaco-action-bar
.action-item
:not
(
.disabled
)
:active
.action-label.extension-action.reload
{
background-color
:
#4294CC
}
.monaco-action-bar
.action-item
.action-label.clear-extensions
{
background
:
url('clear.svg')
center
center
no-repeat
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录