Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e72af78f
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,体验更适合开发者的 AI 搜索 >>
提交
e72af78f
编写于
6月 21, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pimp up extension actions
上级
e8050437
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
70 addition
and
15 deletion
+70
-15
src/vs/base/browser/ui/actionbar/actionbar.css
src/vs/base/browser/ui/actionbar/actionbar.css
+2
-2
src/vs/base/browser/ui/actionbar/actionbar.ts
src/vs/base/browser/ui/actionbar/actionbar.ts
+6
-1
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
...ench/parts/extensions/electron-browser/extensionEditor.ts
+2
-2
src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts
...ch/parts/extensions/electron-browser/extensionsActions.ts
+4
-5
src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts
...bench/parts/extensions/electron-browser/extensionsList.ts
+3
-4
src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css
...ts/extensions/electron-browser/media/extensionActions.css
+48
-1
src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css
...s/extensions/electron-browser/media/extensionsViewlet.css
+5
-0
未找到文件。
src/vs/base/browser/ui/actionbar/actionbar.css
浏览文件 @
e72af78f
...
...
@@ -36,7 +36,7 @@
cursor
:
default
;
}
.monaco-action-bar
.action-item.active
{
.monaco-action-bar
.animated
.action-item.active
{
-ms-transform
:
translate
(
0
,
-3px
);
-webkit-transform
:
translate
(
0
,
-3px
);
-moz-transform
:
translate
(
0
,
-3px
);
...
...
@@ -77,7 +77,7 @@
margin-right
:
.8em
;
}
.monaco-action-bar.vertical
.action-item.active
{
.monaco-action-bar.
animated.
vertical
.action-item.active
{
-ms-transform
:
translate
(
5px
,
0
);
-webkit-transform
:
translate
(
5px
,
0
);
-moz-transform
:
translate
(
5px
,
0
);
...
...
src/vs/base/browser/ui/actionbar/actionbar.ts
浏览文件 @
e72af78f
...
...
@@ -137,7 +137,7 @@ export class BaseActionItem extends EventEmitter implements IActionItem {
public
onClick
(
event
:
Event
):
void
{
DOM
.
EventHelper
.
stop
(
event
,
true
);
let
context
:
any
;
if
(
types
.
isUndefinedOrNull
(
this
.
_context
))
{
context
=
event
;
...
...
@@ -388,6 +388,7 @@ export interface IActionBarOptions {
actionItemProvider
?:
IActionItemProvider
;
actionRunner
?:
IActionRunner
;
ariaLabel
?:
string
;
animated
?:
boolean
;
}
let
defaultOptions
:
IActionBarOptions
=
{
...
...
@@ -440,6 +441,10 @@ export class ActionBar extends EventEmitter implements IActionRunner {
this
.
domNode
=
document
.
createElement
(
'
div
'
);
this
.
domNode
.
className
=
'
monaco-action-bar
'
;
if
(
options
.
animated
!==
false
)
{
DOM
.
addClass
(
this
.
domNode
,
'
animated
'
);
}
let
isVertical
=
this
.
options
.
orientation
===
ActionsOrientation
.
VERTICAL
;
if
(
isVertical
)
{
this
.
domNode
.
className
+=
'
vertical
'
;
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
浏览文件 @
e72af78f
...
...
@@ -28,7 +28,7 @@ import { IExtensionsViewlet } from './extensions';
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
CombinedInstallAction
,
UpdateAction
}
from
'
./extensionsActions
'
;
const
actionOptions
=
{
icon
:
true
,
label
:
fals
e
};
const
actionOptions
=
{
icon
:
true
,
label
:
tru
e
};
export
class
ExtensionEditor
extends
BaseEditor
{
...
...
@@ -85,7 +85,7 @@ export class ExtensionEditor extends BaseEditor {
this
.
description
=
append
(
details
,
$
(
'
.description
'
));
const
actions
=
append
(
details
,
$
(
'
.actions
'
));
this
.
actionBar
=
new
ActionBar
(
actions
);
this
.
actionBar
=
new
ActionBar
(
actions
,
{
animated
:
false
}
);
this
.
body
=
append
(
root
,
$
(
'
.body
'
));
}
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts
浏览文件 @
e72af78f
...
...
@@ -117,7 +117,7 @@ export class InstallAction extends Action {
private
disposables
:
IDisposable
[]
=
[];
constructor
(
private
model
:
ExtensionsModel
,
private
extension
:
IExtension
)
{
super
(
'
extensions.install
'
,
nls
.
localize
(
'
installAction
'
,
"
Install
"
),
'
octicon octicon-cloud-download
'
,
false
);
super
(
'
extensions.install
'
,
nls
.
localize
(
'
installAction
'
,
"
Install
"
),
'
extension-action install
'
,
false
);
this
.
disposables
.
push
(
this
.
model
.
onChange
(()
=>
this
.
updateEnablement
()));
this
.
updateEnablement
();
...
...
@@ -177,7 +177,7 @@ export class UninstallAction extends Action {
private
disposables
:
IDisposable
[]
=
[];
constructor
(
private
model
:
ExtensionsModel
,
private
extension
:
IExtension
)
{
super
(
'
extensions.uninstall
'
,
nls
.
localize
(
'
uninstall
'
,
"
Uninstall
"
),
'
octicon octicon-x
'
,
false
);
super
(
'
extensions.uninstall
'
,
nls
.
localize
(
'
uninstall
'
,
"
Uninstall
"
),
'
extension-action uninstall
'
,
false
);
this
.
disposables
.
push
(
this
.
model
.
onChange
(()
=>
this
.
updateEnablement
()));
this
.
updateEnablement
();
...
...
@@ -194,7 +194,6 @@ export class UninstallAction extends Action {
return
TPromise
.
as
(
null
);
}
return
this
.
model
.
uninstall
(
this
.
extension
);
// this.enabled = false;
...
...
@@ -297,13 +296,13 @@ export class CombinedInstallAction extends Action {
export
class
UpdateAction
extends
Action
{
private
static
EnabledClass
=
'
extension-
update-action octicon octicon-cloud-download
'
;
private
static
EnabledClass
=
'
extension-
action update
'
;
private
static
DisabledClass
=
`
${
UpdateAction
.
EnabledClass
}
disabled`
;
private
disposables
:
IDisposable
[]
=
[];
constructor
(
private
model
:
ExtensionsModel
,
private
extension
:
IExtension
)
{
super
(
'
extensions.
install
'
,
nls
.
localize
(
'
installAction
'
,
"
Install
"
),
UpdateAction
.
DisabledClass
,
false
);
super
(
'
extensions.
update
'
,
nls
.
localize
(
'
updateAction
'
,
"
Update
"
),
UpdateAction
.
DisabledClass
,
false
);
this
.
disposables
.
push
(
this
.
model
.
onChange
(()
=>
this
.
updateEnablement
()));
this
.
updateEnablement
();
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts
浏览文件 @
e72af78f
...
...
@@ -32,7 +32,7 @@ export class Delegate implements IDelegate<IExtension> {
getTemplateId
()
{
return
'
extension
'
;
}
}
const
actionOptions
=
{
icon
:
true
,
label
:
fals
e
};
const
actionOptions
=
{
icon
:
true
,
label
:
tru
e
};
export
class
Renderer
implements
IPagedRenderer
<
IExtension
,
ITemplateData
>
{
...
...
@@ -57,7 +57,7 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
const
version
=
append
(
header
,
$
(
'
span.version.ellipsis
'
));
const
author
=
append
(
header
,
$
(
'
span.author.ellipsis
'
));
const
description
=
append
(
details
,
$
(
'
.description.ellipsis
'
));
const
actionbar
=
new
ActionBar
(
details
);
const
actionbar
=
new
ActionBar
(
details
,
{
animated
:
false
}
);
const
disposables
=
[];
const
result
=
{
extension
:
null
,
element
,
icon
,
name
,
version
,
author
,
description
,
actionbar
,
disposables
};
...
...
@@ -89,13 +89,12 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
data
.
description
.
textContent
=
extension
.
description
;
const
version
=
new
Label
(
data
.
version
,
this
.
model
,
extension
,
e
=>
e
.
version
);
const
installAction
=
new
CombinedInstallAction
(
this
.
model
,
extension
);
const
updateAction
=
new
UpdateAction
(
this
.
model
,
extension
);
data
.
actionbar
.
clear
();
data
.
actionbar
.
push
([
updateAction
,
installAction
],
actionOptions
);
data
.
disposables
.
push
(
version
,
installAction
,
updateAction
);
data
.
disposables
.
push
(
version
,
installAction
,
updateAction
);
}
disposeTemplate
(
data
:
ITemplateData
):
void
{
...
...
src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css
浏览文件 @
e72af78f
...
...
@@ -3,6 +3,53 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-action-bar
.action-item
.icon.extension-update-action.disabled
{
.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.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.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.update
{
background-color
:
#6DA770
;
}
.monaco-action-bar
.action-item.disabled
.action-label.extension-action.update
{
display
:
none
;
}
\ No newline at end of file
src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css
浏览文件 @
e72af78f
...
...
@@ -80,6 +80,11 @@
padding-left
:
6px
;
}
.extensions-viewlet
>
.extensions
.extension
>
.details
>
.monaco-action-bar
.action-label
{
margin-right
:
0
;
margin-left
:
0.3em
;
}
.extensions-viewlet
>
.extensions
.extension
.ellipsis
{
overflow
:
hidden
;
white-space
:
nowrap
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录