Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
80d48da9
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,发现更多精彩内容 >>
提交
80d48da9
编写于
2月 10, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
:lipstick
上级
33b11270
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
48 addition
and
25 deletion
+48
-25
src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts
...orkbench/contrib/preferences/browser/keybindingsEditor.ts
+48
-20
src/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css
...h/contrib/preferences/browser/media/keybindingsEditor.css
+0
-5
未找到文件。
src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts
浏览文件 @
80d48da9
...
...
@@ -50,6 +50,12 @@ import { Emitter, Event } from 'vs/base/common/event';
const
$
=
DOM
.
$
;
interface
ColumnItem
{
column
:
HTMLElement
;
proportion
?:
number
;
width
:
number
;
}
export
class
KeybindingsEditor
extends
BaseEditor
implements
IKeybindingsEditor
{
static
readonly
ID
:
string
=
'
workbench.editor.keybindings
'
;
...
...
@@ -69,7 +75,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
private
overlayContainer
:
HTMLElement
;
private
defineKeybindingWidget
:
DefineKeybindingWidget
;
private
column
s
:
HTMLElement
[]
=
[];
private
column
Items
:
ColumnItem
[]
=
[];
private
keybindingsListContainer
:
HTMLElement
;
private
unAssignedKeybindingItemToRevealAndFocus
:
IKeybindingItemEntry
;
private
listEntries
:
IListEntry
[];
...
...
@@ -142,23 +148,21 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
this
.
overlayContainer
.
style
.
height
=
dimension
.
height
+
'
px
'
;
this
.
defineKeybindingWidget
.
layout
(
this
.
dimension
);
this
.
columnItems
.
forEach
(
columnItem
=>
{
if
(
columnItem
.
proportion
)
{
columnItem
.
width
=
0
;
}
});
this
.
layoutKeybindingsList
();
this
.
_onLayout
.
fire
();
}
layoutColumns
(
columns
:
HTMLElement
[]):
void
{
if
(
this
.
dimension
)
{
const
marginRight
=
6
;
columns
[
0
].
style
.
width
=
'
24px
'
;
const
width
=
this
.
dimension
.
width
-
30
;
columns
[
1
].
style
.
width
=
`
${(
width
*
0.3
)
-
marginRight
}
px`
;
columns
[
2
].
style
.
width
=
`
${(
width
*
0.2
)
-
marginRight
}
px`
;
columns
[
3
].
style
.
width
=
`
${(
width
*
0.5
)
-
marginRight
}
px`
;
columns
[
4
].
style
.
width
=
`
${(
width
*
0.1
)
-
marginRight
}
px`
;
for
(
const
column
of
columns
)
{
column
.
style
.
marginRight
=
`
${
marginRight
}
px`
;
}
if
(
this
.
columnItems
)
{
columns
.
forEach
((
column
,
index
)
=>
{
column
.
style
.
paddingRight
=
`6px`
;
column
.
style
.
width
=
`
${
this
.
columnItems
[
index
].
width
}
px`
;
});
}
}
...
...
@@ -432,12 +436,24 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
const
keybindingsListHeader
=
DOM
.
append
(
parent
,
$
(
'
.keybindings-list-header
'
));
keybindingsListHeader
.
style
.
height
=
'
30px
'
;
keybindingsListHeader
.
style
.
lineHeight
=
'
30px
'
;
this
.
columns
.
push
(
$
(
'
.header.actions
'
));
this
.
columns
.
push
(
$
(
'
.header.command
'
,
undefined
,
localize
(
'
command
'
,
"
Command
"
)));
this
.
columns
.
push
(
$
(
'
.header.keybinding
'
,
undefined
,
localize
(
'
keybinding
'
,
"
Keybinding
"
)));
this
.
columns
.
push
(
$
(
'
.header.when
'
,
undefined
,
localize
(
'
when
'
,
"
When
"
)));
this
.
columns
.
push
(
$
(
'
.header.source
'
,
undefined
,
localize
(
'
source
'
,
"
Source
"
)));
DOM
.
append
(
keybindingsListHeader
,
...
this
.
columns
);
this
.
columnItems
=
[];
let
column
=
$
(
'
.header.actions
'
);
this
.
columnItems
.
push
({
column
,
width
:
30
});
column
=
$
(
'
.header.command
'
,
undefined
,
localize
(
'
command
'
,
"
Command
"
));
this
.
columnItems
.
push
({
column
,
proportion
:
0.3
,
width
:
0
});
column
=
$
(
'
.header.keybinding
'
,
undefined
,
localize
(
'
keybinding
'
,
"
Keybinding
"
));
this
.
columnItems
.
push
({
column
,
proportion
:
0.2
,
width
:
0
});
column
=
$
(
'
.header.when
'
,
undefined
,
localize
(
'
when
'
,
"
When
"
));
this
.
columnItems
.
push
({
column
,
proportion
:
0.4
,
width
:
0
});
column
=
$
(
'
.header.source
'
,
undefined
,
localize
(
'
source
'
,
"
Source
"
));
this
.
columnItems
.
push
({
column
,
proportion
:
0.1
,
width
:
0
});
DOM
.
append
(
keybindingsListHeader
,
...
this
.
columnItems
.
map
(({
column
})
=>
column
));
}
private
createList
(
parent
:
HTMLElement
):
void
{
...
...
@@ -548,7 +564,19 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
}
private
layoutKeybindingsList
():
void
{
this
.
layoutColumns
(
this
.
columns
);
let
width
=
this
.
dimension
.
width
-
27
;
for
(
const
columnItem
of
this
.
columnItems
)
{
if
(
columnItem
.
width
&&
!
columnItem
.
proportion
)
{
width
=
width
-
columnItem
.
width
;
}
}
for
(
const
columnItem
of
this
.
columnItems
)
{
if
(
columnItem
.
proportion
&&
!
columnItem
.
width
)
{
columnItem
.
width
=
width
*
columnItem
.
proportion
;
}
}
this
.
layoutColumns
(
this
.
columnItems
.
map
(({
column
})
=>
column
));
const
listHeight
=
this
.
dimension
.
height
-
(
DOM
.
getDomNodePagePosition
(
this
.
headerContainer
).
height
+
12
/*padding*/
+
30
/*list header*/
);
this
.
keybindingsListContainer
.
style
.
height
=
`
${
listHeight
}
px`
;
this
.
keybindingsList
.
layout
(
listHeight
);
...
...
src/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css
浏览文件 @
80d48da9
...
...
@@ -140,11 +140,6 @@
padding-left
:
10px
;
}
.keybindings-editor
>
.keybindings-body
>
.keybindings-list-header
>
.source
,
.keybindings-editor
>
.keybindings-body
>
.keybindings-list-container
.monaco-list-row
.source
{
flex
:
0
0
100px
;
}
.keybindings-editor
>
.keybindings-body
>
.keybindings-list-container
.monaco-list-row
>
.when
.empty
{
padding-left
:
4px
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录