Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c6828537
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 搜索 >>
提交
c6828537
编写于
6月 20, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
extensions: keyboard navigation
上级
d51eedec
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
60 addition
and
17 deletion
+60
-17
src/vs/base/browser/ui/list/list.css
src/vs/base/browser/ui/list/list.css
+5
-5
src/vs/base/browser/ui/list/listPaging.ts
src/vs/base/browser/ui/list/listPaging.ts
+24
-0
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+12
-4
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
+5
-5
src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts
...ch/parts/extensions/electron-browser/extensionsViewlet.ts
+14
-3
未找到文件。
src/vs/base/browser/ui/list/list.css
浏览文件 @
c6828537
...
...
@@ -47,12 +47,12 @@
.vs-dark
.monaco-list-row
:hover
{
background-color
:
rgba
(
255
,
255
,
255
,
0.08
);
}
.hc-black
.monaco-list-row
:hover
{
outline
:
1px
dashed
#f38518
;
background
:
transparent
;
}
/* Selection */
.monaco-list-row.selected
{
background-color
:
#4FA7FF
;
color
:
white
;
}
.vs-dark
.monaco-list-row.selected
{
background-color
:
#0E639C
;
color
:
white
;
}
.hc-black
.monaco-list-row.selected
{
border
:
1px
solid
#f38518
;
}
/* Focus */
.monaco-list-row.focused
{
background-color
:
#DCEBFC
;
}
.vs-dark
.monaco-list-row.focused
{
background-color
:
#073655
;
}
.hc-black
.monaco-list-row.focused
{
outline
:
1px
dotted
#f38518
;
background
:
transparent
}
/* Selection */
.monaco-list-row.selected
{
background-color
:
#4FA7FF
;
color
:
white
;
}
.vs-dark
.monaco-list-row.selected
{
background-color
:
#0E639C
;
color
:
white
;
}
.hc-black
.monaco-list-row.selected
{
border
:
1px
solid
#f38518
;
}
src/vs/base/browser/ui/list/listPaging.ts
浏览文件 @
c6828537
...
...
@@ -93,6 +93,30 @@ export class PagedList<T> {
return
this
.
list
.
scrollTop
;
}
focusNext
(
n
?:
number
,
loop
?:
boolean
):
void
{
this
.
list
.
focusNext
(
n
,
loop
);
}
focusPrevious
(
n
?:
number
,
loop
?:
boolean
):
void
{
this
.
list
.
focusPrevious
(
n
,
loop
);
}
selectNext
(
n
?:
number
,
loop
?:
boolean
):
void
{
this
.
list
.
selectNext
(
n
,
loop
);
}
selectPrevious
(
n
?:
number
,
loop
?:
boolean
):
void
{
this
.
list
.
selectPrevious
(
n
,
loop
);
}
getFocus
():
number
[]
{
return
this
.
list
.
getFocus
();
}
setSelection
(...
indexes
:
number
[]):
void
{
this
.
list
.
setSelection
(...
indexes
);
}
layout
(
height
?:
number
):
void
{
this
.
list
.
layout
(
height
);
}
...
...
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
c6828537
...
...
@@ -239,6 +239,10 @@ export class List<T> implements IDisposable {
this
.
setSelection
(
Math
.
max
(
index
,
0
));
}
getSelection
():
number
[]
{
return
this
.
selection
.
get
();
}
setFocus
(...
indexes
:
number
[]):
void
{
this
.
eventBufferer
.
bufferEvents
(()
=>
{
indexes
=
indexes
.
concat
(
this
.
focus
.
set
(...
indexes
));
...
...
@@ -265,7 +269,7 @@ export class List<T> implements IDisposable {
let
lastPageIndex
=
this
.
view
.
indexAt
(
this
.
view
.
getScrollTop
()
+
this
.
view
.
renderHeight
);
lastPageIndex
=
lastPageIndex
===
0
?
0
:
lastPageIndex
-
1
;
const
lastPageElement
=
this
.
view
.
element
(
lastPageIndex
);
const
currentlyFocusedElement
=
this
.
getFocus
()[
0
];
const
currentlyFocusedElement
=
this
.
getFocus
edElements
()[
0
];
if
(
currentlyFocusedElement
!==
lastPageElement
)
{
this
.
setFocus
(
lastPageIndex
);
...
...
@@ -291,7 +295,7 @@ export class List<T> implements IDisposable {
}
const
firstPageElement
=
this
.
view
.
element
(
firstPageIndex
);
const
currentlyFocusedElement
=
this
.
getFocus
()[
0
];
const
currentlyFocusedElement
=
this
.
getFocus
edElements
()[
0
];
if
(
currentlyFocusedElement
!==
firstPageElement
)
{
this
.
setFocus
(
firstPageIndex
);
...
...
@@ -306,8 +310,12 @@ export class List<T> implements IDisposable {
}
}
getFocus
():
T
[]
{
return
this
.
focus
.
get
().
map
(
i
=>
this
.
view
.
element
(
i
));
getFocus
():
number
[]
{
return
this
.
focus
.
get
();
}
getFocusedElements
():
T
[]
{
return
this
.
getFocus
().
map
(
i
=>
this
.
view
.
element
(
i
));
}
reveal
(
index
:
number
,
relativeTop
?:
number
):
void
{
...
...
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
浏览文件 @
c6828537
...
...
@@ -143,7 +143,7 @@ class Delegate implements IDelegate<CompletionItem> {
constructor
(
private
listProvider
:
()
=>
List
<
CompletionItem
>
)
{
}
getHeight
(
element
:
CompletionItem
):
number
{
const
focus
=
this
.
listProvider
().
getFocus
()[
0
];
const
focus
=
this
.
listProvider
().
getFocus
edElements
()[
0
];
if
(
element
.
suggestion
.
documentationLabel
&&
element
===
focus
)
{
return
FocusHeight
;
...
...
@@ -735,7 +735,7 @@ export class SuggestWidget implements IContentWidget, IDisposable {
case
State
.
Loading
:
return
!
this
.
isAuto
;
default
:
const
focus
=
this
.
list
.
getFocus
()[
0
];
const
focus
=
this
.
list
.
getFocus
edElements
()[
0
];
if
(
focus
)
{
this
.
list
.
setSelection
(
this
.
completionModel
.
items
.
indexOf
(
focus
));
}
else
{
...
...
@@ -756,7 +756,7 @@ export class SuggestWidget implements IContentWidget, IDisposable {
return
;
}
const
item
=
this
.
list
.
getFocus
()[
0
];
const
item
=
this
.
list
.
getFocus
edElements
()[
0
];
if
(
!
item
||
!
item
.
suggestion
.
documentationLabel
)
{
return
;
...
...
@@ -820,7 +820,7 @@ export class SuggestWidget implements IContentWidget, IDisposable {
}
else
if
(
this
.
state
===
State
.
Details
)
{
height
=
12
*
UnfocusedHeight
;
}
else
{
const
focus
=
this
.
list
.
getFocus
()[
0
];
const
focus
=
this
.
list
.
getFocus
edElements
()[
0
];
const
focusHeight
=
focus
?
this
.
delegate
.
getHeight
(
focus
)
:
UnfocusedHeight
;
height
=
focusHeight
;
...
...
@@ -839,7 +839,7 @@ export class SuggestWidget implements IContentWidget, IDisposable {
if
(
this
.
state
!==
State
.
Details
)
{
this
.
details
.
render
(
null
);
}
else
{
this
.
details
.
render
(
this
.
list
.
getFocus
()[
0
]);
this
.
details
.
render
(
this
.
list
.
getFocus
edElements
()[
0
]);
}
}
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts
浏览文件 @
c6828537
...
...
@@ -124,9 +124,20 @@ export class ExtensionsViewlet extends Viewlet {
}
private
onSearchKeyDown
(
e
:
StandardKeyboardEvent
):
void
{
if
(
e
.
keyCode
===
KeyCode
.
Escape
)
{
this
.
searchBox
.
value
=
''
;
this
.
triggerSearch
(
0
);
switch
(
e
.
keyCode
)
{
case
KeyCode
.
DownArrow
:
this
.
list
.
focusNext
();
break
;
case
KeyCode
.
UpArrow
:
this
.
list
.
focusPrevious
();
break
;
case
KeyCode
.
Enter
:
this
.
list
.
setSelection
(...
this
.
list
.
getFocus
());
break
;
case
KeyCode
.
Escape
:
this
.
searchBox
.
value
=
''
;
this
.
triggerSearch
(
0
);
break
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录