Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
5a5c5eca
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,发现更多精彩内容 >>
未验证
提交
5a5c5eca
编写于
6月 12, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
disable horizontal scrolling while rename widget is active
fixes #71291
上级
32a0c9ed
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
68 addition
and
23 deletion
+68
-23
src/vs/base/browser/ui/list/listView.ts
src/vs/base/browser/ui/list/listView.ts
+32
-23
src/vs/base/browser/ui/tree/abstractTree.ts
src/vs/base/browser/ui/tree/abstractTree.ts
+1
-0
src/vs/base/browser/ui/tree/asyncDataTree.ts
src/vs/base/browser/ui/tree/asyncDataTree.ts
+4
-0
src/vs/workbench/contrib/debug/browser/variablesView.ts
src/vs/workbench/contrib/debug/browser/variablesView.ts
+9
-0
src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts
...s/workbench/contrib/debug/browser/watchExpressionsView.ts
+9
-0
src/vs/workbench/contrib/files/browser/views/explorerView.ts
src/vs/workbench/contrib/files/browser/views/explorerView.ts
+13
-0
未找到文件。
src/vs/base/browser/ui/list/listView.ts
浏览文件 @
5a5c5eca
...
...
@@ -227,7 +227,6 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
private
setRowLineHeight
:
boolean
;
private
setRowHeight
:
boolean
;
private
supportDynamicHeights
:
boolean
;
private
horizontalScrolling
:
boolean
;
private
additionalScrollHeight
:
number
;
private
accessibilityProvider
:
ListViewAccessibilityProvider
<
T
>
;
private
scrollWidth
:
number
|
undefined
;
...
...
@@ -249,6 +248,35 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
get
onWillScroll
():
Event
<
ScrollEvent
>
{
return
this
.
scrollableElement
.
onWillScroll
;
}
get
containerDomNode
():
HTMLElement
{
return
this
.
rowsContainer
;
}
private
_horizontalScrolling
:
boolean
=
false
;
private
get
horizontalScrolling
():
boolean
{
return
this
.
_horizontalScrolling
;
}
private
set
horizontalScrolling
(
value
:
boolean
)
{
if
(
value
===
this
.
_horizontalScrolling
)
{
return
;
}
if
(
value
&&
this
.
supportDynamicHeights
)
{
throw
new
Error
(
'
Horizontal scrolling and dynamic heights not supported simultaneously
'
);
}
this
.
_horizontalScrolling
=
value
;
DOM
.
toggleClass
(
this
.
domNode
,
'
horizontal-scrolling
'
,
this
.
_horizontalScrolling
);
if
(
this
.
_horizontalScrolling
)
{
for
(
const
item
of
this
.
items
)
{
this
.
measureItemWidth
(
item
);
}
this
.
updateScrollWidth
();
this
.
scrollableElement
.
setScrollDimensions
({
width
:
DOM
.
getContentWidth
(
this
.
domNode
)
});
this
.
rowsContainer
.
style
.
width
=
`
${
Math
.
max
(
this
.
scrollWidth
||
0
,
this
.
renderWidth
)}
px`
;
}
else
{
this
.
scrollableElementWidthDelayer
.
cancel
();
this
.
scrollableElement
.
setScrollDimensions
({
width
:
this
.
renderWidth
,
scrollWidth
:
this
.
renderWidth
});
this
.
rowsContainer
.
style
.
width
=
''
;
}
}
constructor
(
container
:
HTMLElement
,
private
virtualDelegate
:
IListVirtualDelegate
<
T
>
,
...
...
@@ -280,8 +308,8 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
DOM
.
toggleClass
(
this
.
domNode
,
'
mouse-support
'
,
typeof
options
.
mouseSupport
===
'
boolean
'
?
options
.
mouseSupport
:
true
);
this
.
horizontalScrolling
=
getOrDefault
(
options
,
o
=>
o
.
horizontalScrolling
,
DefaultOptions
.
horizontalScrolling
);
DOM
.
toggleClass
(
this
.
domNode
,
'
horizontal-scrolling
'
,
this
.
horizontalScrolling
);
this
.
_
horizontalScrolling
=
getOrDefault
(
options
,
o
=>
o
.
horizontalScrolling
,
DefaultOptions
.
horizontalScrolling
);
DOM
.
toggleClass
(
this
.
domNode
,
'
horizontal-scrolling
'
,
this
.
_
horizontalScrolling
);
this
.
additionalScrollHeight
=
typeof
options
.
additionalScrollHeight
===
'
undefined
'
?
0
:
options
.
additionalScrollHeight
;
...
...
@@ -338,27 +366,8 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
this
.
scrollable
.
setSmoothScrollDuration
(
options
.
smoothScrolling
?
125
:
0
);
}
if
(
options
.
horizontalScrolling
!==
undefined
&&
options
.
horizontalScrolling
!==
this
.
horizontalScrolling
)
{
if
(
options
.
horizontalScrolling
&&
this
.
supportDynamicHeights
)
{
throw
new
Error
(
'
Horizontal scrolling and dynamic heights not supported simultaneously
'
);
}
if
(
options
.
horizontalScrolling
!==
undefined
)
{
this
.
horizontalScrolling
=
options
.
horizontalScrolling
;
DOM
.
toggleClass
(
this
.
domNode
,
'
horizontal-scrolling
'
,
this
.
horizontalScrolling
);
if
(
this
.
horizontalScrolling
)
{
for
(
const
item
of
this
.
items
)
{
this
.
measureItemWidth
(
item
);
}
this
.
updateScrollWidth
();
this
.
scrollableElement
.
setScrollDimensions
({
width
:
DOM
.
getContentWidth
(
this
.
domNode
)
});
this
.
rowsContainer
.
style
.
width
=
`
${
Math
.
max
(
this
.
scrollWidth
||
0
,
this
.
renderWidth
)}
px`
;
}
else
{
this
.
scrollableElementWidthDelayer
.
cancel
();
this
.
scrollableElement
.
setScrollDimensions
({
width
:
this
.
renderWidth
,
scrollWidth
:
this
.
renderWidth
});
this
.
rowsContainer
.
style
.
width
=
''
;
}
}
}
...
...
src/vs/base/browser/ui/tree/abstractTree.ts
浏览文件 @
5a5c5eca
...
...
@@ -962,6 +962,7 @@ export interface IAbstractTreeOptionsUpdate extends ITreeRendererOptions {
readonly
filterOnType
?:
boolean
;
readonly
openOnSingleClick
?:
boolean
;
readonly
smoothScrolling
?:
boolean
;
readonly
horizontalScrolling
?:
boolean
;
}
export
interface
IAbstractTreeOptions
<
T
,
TFilterData
=
void
>
extends
IAbstractTreeOptionsUpdate
,
IListOptions
<
T
>
{
...
...
src/vs/base/browser/ui/tree/asyncDataTree.ts
浏览文件 @
5a5c5eca
...
...
@@ -407,6 +407,10 @@ export class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable
this
.
tree
.
updateOptions
(
options
);
}
get
options
():
IAsyncDataTreeOptions
<
T
,
TFilterData
>
{
return
this
.
tree
.
options
as
IAsyncDataTreeOptions
<
T
,
TFilterData
>
;
}
// Widget
getHTMLElement
():
HTMLElement
{
...
...
src/vs/workbench/contrib/debug/browser/variablesView.ts
浏览文件 @
5a5c5eca
...
...
@@ -141,9 +141,18 @@ export class VariablesView extends ViewPane {
this
.
onFocusStackFrameScheduler
.
schedule
();
}
}));
let
horizontalScrolling
:
boolean
|
undefined
;
this
.
_register
(
this
.
debugService
.
getViewModel
().
onDidSelectExpression
(
e
=>
{
if
(
e
instanceof
Variable
)
{
horizontalScrolling
=
this
.
tree
.
options
.
horizontalScrolling
;
if
(
horizontalScrolling
)
{
this
.
tree
.
updateOptions
({
horizontalScrolling
:
false
});
}
this
.
tree
.
rerender
(
e
);
}
else
if
(
!
e
&&
horizontalScrolling
!==
undefined
)
{
this
.
tree
.
updateOptions
({
horizontalScrolling
:
horizontalScrolling
});
horizontalScrolling
=
undefined
;
}
}));
this
.
_register
(
this
.
debugService
.
onDidEndSession
(()
=>
{
...
...
src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts
浏览文件 @
5a5c5eca
...
...
@@ -134,9 +134,18 @@ export class WatchExpressionsView extends ViewPane {
this
.
onWatchExpressionsUpdatedScheduler
.
schedule
();
}
}));
let
horizontalScrolling
:
boolean
|
undefined
;
this
.
_register
(
this
.
debugService
.
getViewModel
().
onDidSelectExpression
(
e
=>
{
if
(
e
instanceof
Expression
&&
e
.
name
)
{
horizontalScrolling
=
this
.
tree
.
options
.
horizontalScrolling
;
if
(
horizontalScrolling
)
{
this
.
tree
.
updateOptions
({
horizontalScrolling
:
false
});
}
this
.
tree
.
rerender
(
e
);
}
else
if
(
!
e
&&
horizontalScrolling
!==
undefined
)
{
this
.
tree
.
updateOptions
({
horizontalScrolling
:
horizontalScrolling
});
horizontalScrolling
=
undefined
;
}
}));
}
...
...
src/vs/workbench/contrib/files/browser/views/explorerView.ts
浏览文件 @
5a5c5eca
...
...
@@ -140,6 +140,8 @@ export class ExplorerView extends ViewPane {
private
compressedFocusFirstContext
:
IContextKey
<
boolean
>
;
private
compressedFocusLastContext
:
IContextKey
<
boolean
>
;
private
horizontalScrolling
:
boolean
|
undefined
;
// Refresh is needed on the initial explorer open
private
shouldRefresh
=
true
;
private
dragHandler
!
:
DelayedDragHandler
;
...
...
@@ -309,8 +311,19 @@ export class ExplorerView extends ViewPane {
async
setEditable
(
stat
:
ExplorerItem
,
isEditing
:
boolean
):
Promise
<
void
>
{
if
(
isEditing
)
{
this
.
horizontalScrolling
=
this
.
tree
.
options
.
horizontalScrolling
;
if
(
this
.
horizontalScrolling
)
{
this
.
tree
.
updateOptions
({
horizontalScrolling
:
false
});
}
await
this
.
tree
.
expand
(
stat
.
parent
!
);
}
else
{
if
(
this
.
horizontalScrolling
!==
undefined
)
{
this
.
tree
.
updateOptions
({
horizontalScrolling
:
this
.
horizontalScrolling
});
}
this
.
horizontalScrolling
=
undefined
;
DOM
.
removeClass
(
this
.
treeContainer
,
'
highlight
'
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录