Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f35fa2bb
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,发现更多精彩内容 >>
提交
f35fa2bb
编写于
6月 15, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
list: useShadows options
上级
e3c4f05e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
7 deletion
+24
-7
src/vs/base/browser/ui/list/listView.ts
src/vs/base/browser/ui/list/listView.ts
+12
-3
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+9
-3
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
+3
-1
未找到文件。
src/vs/base/browser/ui/list/listView.ts
浏览文件 @
f35fa2bb
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
toObject
,
assign
}
from
'
vs/base/common/objects
'
;
import
{
toObject
,
assign
,
getOrDefault
}
from
'
vs/base/common/objects
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
Gesture
}
from
'
vs/base/browser/touch
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
...
...
@@ -38,6 +38,14 @@ const MouseEventTypes = [
'
contextmenu
'
];
export
interface
IListViewOptions
{
useShadows
?:
boolean
;
}
const
DefaultOptions
:
IListViewOptions
=
{
useShadows
:
true
};
export
class
ListView
<
T
>
implements
IDisposable
{
private
items
:
IItem
<
T
>
[];
...
...
@@ -56,7 +64,8 @@ export class ListView<T> implements IDisposable {
constructor
(
container
:
HTMLElement
,
private
delegate
:
IDelegate
<
T
>
,
renderers
:
IRenderer
<
T
,
any
>
[]
renderers
:
IRenderer
<
T
,
any
>
[],
options
:
IListViewOptions
=
DefaultOptions
)
{
this
.
items
=
[];
this
.
itemId
=
0
;
...
...
@@ -79,7 +88,7 @@ export class ListView<T> implements IDisposable {
canUseTranslate3d
:
false
,
horizontal
:
ScrollbarVisibility
.
Hidden
,
vertical
:
ScrollbarVisibility
.
Auto
,
useShadows
:
false
,
useShadows
:
getOrDefault
(
options
,
o
=>
o
.
useShadows
,
DefaultOptions
.
useShadows
)
,
saveLastScrollTimeOnClassName
:
'
monaco-list-row
'
});
...
...
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
f35fa2bb
...
...
@@ -9,7 +9,7 @@ import { isNumber } from 'vs/base/common/types';
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
Event
,
{
Emitter
,
mapEvent
,
EventBufferer
}
from
'
vs/base/common/event
'
;
import
{
IDelegate
,
IRenderer
,
IListMouseEvent
,
IFocusChangeEvent
,
ISelectionChangeEvent
}
from
'
./list
'
;
import
{
ListView
}
from
'
./listView
'
;
import
{
ListView
,
IListViewOptions
}
from
'
./listView
'
;
interface
ITraitTemplateData
<
D
>
{
container
:
HTMLElement
;
...
...
@@ -146,6 +146,11 @@ class Controller<T> implements IDisposable {
}
}
export
interface
IListOptions
extends
IListViewOptions
{
}
const
DefaultOptions
:
IListOptions
=
{};
export
class
List
<
T
>
implements
IDisposable
{
private
static
InstanceCount
=
0
;
...
...
@@ -168,7 +173,8 @@ export class List<T> implements IDisposable {
constructor
(
container
:
HTMLElement
,
delegate
:
IDelegate
<
T
>
,
renderers
:
IRenderer
<
T
,
any
>
[]
renderers
:
IRenderer
<
T
,
any
>
[],
options
:
IListOptions
=
DefaultOptions
)
{
this
.
focus
=
new
FocusTrait
(
i
=>
this
.
getElementId
(
i
));
this
.
selection
=
new
Trait
(
'
selected
'
);
...
...
@@ -180,7 +186,7 @@ export class List<T> implements IDisposable {
return
r
;
});
this
.
view
=
new
ListView
(
container
,
delegate
,
renderers
);
this
.
view
=
new
ListView
(
container
,
delegate
,
renderers
,
options
);
this
.
view
.
domNode
.
setAttribute
(
'
role
'
,
'
listbox
'
);
this
.
controller
=
new
Controller
(
this
,
this
.
view
);
}
...
...
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
浏览文件 @
f35fa2bb
...
...
@@ -364,7 +364,9 @@ export class SuggestWidget implements IContentWidget, IDisposable {
let
renderer
:
IRenderer
<
CompletionItem
,
any
>
=
instantiationService
.
createInstance
(
Renderer
,
this
,
this
.
editor
);
this
.
delegate
=
new
Delegate
(()
=>
this
.
list
);
this
.
list
=
new
List
(
this
.
listElement
,
this
.
delegate
,
[
renderer
]);
this
.
list
=
new
List
(
this
.
listElement
,
this
.
delegate
,
[
renderer
],
{
useShadows
:
false
});
this
.
toDispose
=
[
editor
.
onDidBlurEditorText
(()
=>
this
.
onEditorBlur
()),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录