Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
b9cdcecf
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,发现更多精彩内容 >>
提交
b9cdcecf
编写于
1月 23, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polish from feedback
上级
59745016
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
22 addition
and
31 deletion
+22
-31
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+1
-1
src/vs/platform/actions/browser/menuItemActionItem.ts
src/vs/platform/actions/browser/menuItemActionItem.ts
+12
-21
src/vs/platform/actions/common/actions.ts
src/vs/platform/actions/common/actions.ts
+1
-1
src/vs/platform/actions/electron-browser/menusExtensionPoint.ts
.../platform/actions/electron-browser/menusExtensionPoint.ts
+2
-2
src/vs/workbench/browser/parts/editor/editor.contribution.ts
src/vs/workbench/browser/parts/editor/editor.contribution.ts
+2
-2
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
...bench/parts/codeEditor/electron-browser/toggleWordWrap.ts
+2
-2
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
...kbench/parts/debug/electron-browser/debug.contribution.ts
+1
-1
src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts
.../parts/files/electron-browser/fileActions.contribution.ts
+1
-1
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
b9cdcecf
...
...
@@ -953,7 +953,7 @@ export class CodeWindow implements ICodeWindow {
const
segments
:
ITouchBarSegment
[]
=
items
.
map
(
item
=>
{
let
icon
:
Electron
.
NativeImage
;
if
(
item
.
iconPath
)
{
icon
=
nativeImage
.
createFromPath
(
typeof
item
.
iconPath
===
'
string
'
?
item
.
iconPath
:
item
.
iconPath
.
dark
);
icon
=
nativeImage
.
createFromPath
(
item
.
iconPath
.
dark
);
if
(
icon
.
isEmpty
())
{
icon
=
void
0
;
}
...
...
src/vs/platform/actions/browser/menuItemActionItem.ts
浏览文件 @
b9cdcecf
...
...
@@ -127,12 +127,12 @@ export class MenuItemActionItem extends ActionItem {
private
_itemClassDispose
:
IDisposable
;
constructor
(
p
rivate
action
:
MenuItemAction
,
p
ublic
_
action
:
MenuItemAction
,
@
IKeybindingService
private
_keybindingService
:
IKeybindingService
,
@
IMessageService
protected
_messageService
:
IMessageService
,
@
IContextMenuService
private
_contextMenuService
:
IContextMenuService
)
{
super
(
undefined
,
action
,
{
icon
:
!!
(
action
.
class
||
action
.
item
.
iconPath
),
label
:
!
action
.
class
&&
!
action
.
item
.
iconPath
});
super
(
undefined
,
_action
,
{
icon
:
!!
(
_action
.
class
||
_action
.
item
.
iconPath
),
label
:
!
_action
.
class
&&
!
_
action
.
item
.
iconPath
});
}
protected
get
_commandAction
():
IAction
{
...
...
@@ -150,7 +150,7 @@ export class MenuItemActionItem extends ActionItem {
render
(
container
:
HTMLElement
):
void
{
super
.
render
(
container
);
this
.
_updateItemClass
(
this
.
action
.
item
);
this
.
_updateItemClass
(
this
.
_
action
.
item
);
let
mouseOver
=
false
;
let
altDown
=
false
;
...
...
@@ -200,9 +200,9 @@ export class MenuItemActionItem extends ActionItem {
_updateClass
():
void
{
if
(
this
.
options
.
icon
)
{
if
(
this
.
_commandAction
!==
this
.
_action
)
{
this
.
_updateItemClass
(
this
.
action
.
alt
.
item
);
this
.
_updateItemClass
(
this
.
_
action
.
alt
.
item
);
}
else
if
((
<
MenuItemAction
>
this
.
_action
).
alt
)
{
this
.
_updateItemClass
(
this
.
action
.
item
);
this
.
_updateItemClass
(
this
.
_
action
.
item
);
}
}
}
...
...
@@ -213,23 +213,14 @@ export class MenuItemActionItem extends ActionItem {
if
(
item
.
iconPath
)
{
let
iconClass
:
string
;
if
(
typeof
item
.
iconPath
===
'
string
'
)
{
if
(
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
has
(
item
.
iconPath
))
{
iconClass
=
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
get
(
item
.
iconPath
);
}
else
{
iconClass
=
ids
.
nextId
();
createCSSRule
(
`.icon.
${
iconClass
}
`
,
`background-image: url("
${
URI
.
file
(
item
.
iconPath
).
toString
()}
")`
);
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
set
(
item
.
iconPath
,
iconClass
);
}
if
(
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
has
(
item
.
iconPath
.
dark
))
{
iconClass
=
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
get
(
item
.
iconPath
.
dark
);
}
else
{
if
(
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
has
(
item
.
iconPath
.
dark
))
{
iconClass
=
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
get
(
item
.
iconPath
.
dark
);
}
else
{
iconClass
=
ids
.
nextId
();
createCSSRule
(
`.icon.
${
iconClass
}
`
,
`background-image: url("
${
URI
.
file
(
item
.
iconPath
.
light
).
toString
()}
")`
);
createCSSRule
(
`.vs-dark .icon.
${
iconClass
}
, .hc-black .icon.
${
iconClass
}
`
,
`background-image: url("
${
URI
.
file
(
item
.
iconPath
.
dark
).
toString
()}
")`
);
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
set
(
item
.
iconPath
.
dark
,
iconClass
);
}
iconClass
=
ids
.
nextId
();
createCSSRule
(
`.icon.
${
iconClass
}
`
,
`background-image: url("
${
URI
.
file
(
item
.
iconPath
.
light
||
item
.
iconPath
.
dark
).
toString
()}
")`
);
createCSSRule
(
`.vs-dark .icon.
${
iconClass
}
, .hc-black .icon.
${
iconClass
}
`
,
`background-image: url("
${
URI
.
file
(
item
.
iconPath
.
dark
).
toString
()}
")`
);
MenuItemActionItem
.
ICON_PATH_TO_CSS_RULES
.
set
(
item
.
iconPath
.
dark
,
iconClass
);
}
this
.
$e
.
getHTMLElement
().
classList
.
add
(
'
icon
'
,
iconClass
);
...
...
src/vs/platform/actions/common/actions.ts
浏览文件 @
b9cdcecf
...
...
@@ -23,7 +23,7 @@ export interface ICommandAction {
id
:
string
;
title
:
string
|
ILocalizedString
;
category
?:
string
|
ILocalizedString
;
iconPath
?:
string
|
{
light
:
string
;
dark
:
string
;
};
iconPath
?:
{
dark
:
string
;
light
?
:
string
;
};
precondition
?:
ContextKeyExpr
;
}
...
...
src/vs/platform/actions/electron-browser/menusExtensionPoint.ts
浏览文件 @
b9cdcecf
...
...
@@ -286,10 +286,10 @@ ExtensionsRegistry.registerExtensionPoint<schema.IUserFriendlyCommand | schema.I
const
{
icon
,
category
,
title
,
command
}
=
userFriendlyCommand
;
let
absoluteIcon
:
string
|
{
light
:
string
;
dark
:
string
;
};
let
absoluteIcon
:
{
dark
:
string
;
light
?
:
string
;
};
if
(
icon
)
{
if
(
typeof
icon
===
'
string
'
)
{
absoluteIcon
=
join
(
extension
.
description
.
extensionFolderPath
,
icon
)
;
absoluteIcon
=
{
dark
:
join
(
extension
.
description
.
extensionFolderPath
,
icon
)
}
;
}
else
{
absoluteIcon
=
{
dark
:
join
(
extension
.
description
.
extensionFolderPath
,
icon
.
dark
),
...
...
src/vs/workbench/browser/parts/editor/editor.contribution.ts
浏览文件 @
b9cdcecf
...
...
@@ -403,12 +403,12 @@ editorCommands.setup();
// Touch Bar
if
(
isMacintosh
)
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
TouchBarContext
,
{
command
:
{
id
:
NavigateBackwardsAction
.
ID
,
title
:
NavigateBackwardsAction
.
LABEL
,
iconPath
:
URI
.
parse
(
require
.
toUrl
(
'
vs/workbench/browser/parts/editor/media/back-tb.png
'
)).
fsPath
},
command
:
{
id
:
NavigateBackwardsAction
.
ID
,
title
:
NavigateBackwardsAction
.
LABEL
,
iconPath
:
{
dark
:
URI
.
parse
(
require
.
toUrl
(
'
vs/workbench/browser/parts/editor/media/back-tb.png
'
)).
fsPath
}
},
group
:
'
navigation
'
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
TouchBarContext
,
{
command
:
{
id
:
NavigateForwardAction
.
ID
,
title
:
NavigateForwardAction
.
LABEL
,
iconPath
:
URI
.
parse
(
require
.
toUrl
(
'
vs/workbench/browser/parts/editor/media/forward-tb.png
'
)).
fsPath
},
command
:
{
id
:
NavigateForwardAction
.
ID
,
title
:
NavigateForwardAction
.
LABEL
,
iconPath
:
{
dark
:
URI
.
parse
(
require
.
toUrl
(
'
vs/workbench/browser/parts/editor/media/forward-tb.png
'
)).
fsPath
}
},
group
:
'
navigation
'
});
}
...
...
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
浏览文件 @
b9cdcecf
...
...
@@ -258,7 +258,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command
:
{
id
:
'
editor.action.toggleWordWrap
'
,
title
:
nls
.
localize
(
'
unwrapMinified
'
,
"
Disable wrapping for this file
"
),
iconPath
:
URI
.
parse
(
require
.
toUrl
(
'
vs/workbench/parts/codeEditor/electron-browser/WordWrap_16x.svg
'
)).
fsPath
iconPath
:
{
dark
:
URI
.
parse
(
require
.
toUrl
(
'
vs/workbench/parts/codeEditor/electron-browser/WordWrap_16x.svg
'
)).
fsPath
}
},
group
:
'
navigation
'
,
order
:
1
,
...
...
@@ -272,7 +272,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command
:
{
id
:
'
editor.action.toggleWordWrap
'
,
title
:
nls
.
localize
(
'
wrapMinified
'
,
"
Enable wrapping for this file
"
),
iconPath
:
URI
.
parse
(
require
.
toUrl
(
'
vs/workbench/parts/codeEditor/electron-browser/WordWrap_16x.svg
'
)).
fsPath
iconPath
:
{
dark
:
URI
.
parse
(
require
.
toUrl
(
'
vs/workbench/parts/codeEditor/electron-browser/WordWrap_16x.svg
'
)).
fsPath
}
},
group
:
'
navigation
'
,
order
:
1
,
...
...
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
浏览文件 @
b9cdcecf
...
...
@@ -223,7 +223,7 @@ if (isMacintosh) {
const
registerTouchBarEntry
=
(
id
:
string
,
title
:
string
,
order
,
when
:
ContextKeyExpr
,
icon
:
string
)
=>
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
TouchBarContext
,
{
command
:
{
id
,
title
,
iconPath
:
URI
.
parse
(
require
.
toUrl
(
`vs/workbench/parts/debug/electron-browser/media/
${
icon
}
`
)).
fsPath
id
,
title
,
iconPath
:
{
dark
:
URI
.
parse
(
require
.
toUrl
(
`vs/workbench/parts/debug/electron-browser/media/
${
icon
}
`
)).
fsPath
}
},
when
,
group
:
'
9_debug
'
,
...
...
src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts
浏览文件 @
b9cdcecf
...
...
@@ -125,7 +125,7 @@ appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges',
dark
:
URI
.
parse
(
require
.
toUrl
(
`vs/workbench/parts/files/electron-browser/media/undo-inverse.svg`
)).
fsPath
},
-
9
,
revertLocalChangesCommand
);
function
appendSaveConflictEditorTitleAction
(
id
:
string
,
title
:
string
,
iconPath
:
{
dark
:
string
;
light
:
string
;
},
order
:
number
,
command
:
ICommandHandler
):
void
{
function
appendSaveConflictEditorTitleAction
(
id
:
string
,
title
:
string
,
iconPath
:
{
dark
:
string
;
light
?
:
string
;
},
order
:
number
,
command
:
ICommandHandler
):
void
{
// Command
CommandsRegistry
.
registerCommand
(
id
,
command
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录