Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b069dbe0
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(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b069dbe0
编写于
12月 18, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tab decorations need to update scrollbar (fix #112799)
上级
e588e04b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
12 deletion
+40
-12
src/vs/workbench/browser/labels.ts
src/vs/workbench/browser/labels.ts
+27
-8
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+12
-3
src/vs/workbench/browser/parts/editor/titleControl.ts
src/vs/workbench/browser/parts/editor/titleControl.ts
+1
-1
未找到文件。
src/vs/workbench/browser/labels.ts
浏览文件 @
b069dbe0
...
...
@@ -100,6 +100,10 @@ export const DEFAULT_LABELS_CONTAINER: IResourceLabelsContainer = {
};
export
class
ResourceLabels
extends
Disposable
{
private
_onDidChangeDecorations
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidChangeDecorations
=
this
.
_onDidChangeDecorations
.
event
;
private
widgets
:
ResourceLabelWidget
[]
=
[];
private
labels
:
IResourceLabel
[]
=
[];
...
...
@@ -148,7 +152,18 @@ export class ResourceLabels extends Disposable {
}));
// notify when file decoration changes
this
.
_register
(
this
.
decorationsService
.
onDidChangeDecorations
(
e
=>
this
.
widgets
.
forEach
(
widget
=>
widget
.
notifyFileDecorationsChanges
(
e
))));
this
.
_register
(
this
.
decorationsService
.
onDidChangeDecorations
(
e
=>
{
let
notifyDidChangeDecorations
=
false
;
this
.
widgets
.
forEach
(
widget
=>
{
if
(
widget
.
notifyFileDecorationsChanges
(
e
))
{
notifyDidChangeDecorations
=
true
;
}
});
if
(
notifyDidChangeDecorations
)
{
this
.
_onDidChangeDecorations
.
fire
();
}
}));
// notify when theme changes
this
.
_register
(
this
.
themeService
.
onDidColorThemeChange
(()
=>
this
.
widgets
.
forEach
(
widget
=>
widget
.
notifyThemeChange
())));
...
...
@@ -311,19 +326,21 @@ class ResourceLabelWidget extends IconLabel {
}
}
notifyFileDecorationsChanges
(
e
:
IResourceDecorationChangeEvent
):
void
{
notifyFileDecorationsChanges
(
e
:
IResourceDecorationChangeEvent
):
boolean
{
if
(
!
this
.
options
)
{
return
;
return
false
;
}
const
resource
=
toResource
(
this
.
label
);
if
(
!
resource
)
{
return
;
return
false
;
}
if
(
this
.
options
.
fileDecorations
&&
e
.
affectsResource
(
resource
))
{
this
.
render
(
false
);
return
this
.
render
(
false
);
}
return
false
;
}
notifyExtensionsRegistered
():
void
{
...
...
@@ -465,7 +482,7 @@ class ResourceLabelWidget extends IconLabel {
this
.
setLabel
(
''
);
}
private
render
(
clearIconCache
:
boolean
):
void
{
private
render
(
clearIconCache
:
boolean
):
boolean
{
if
(
this
.
isHidden
)
{
if
(
!
this
.
needsRedraw
)
{
this
.
needsRedraw
=
clearIconCache
?
Redraw
.
Full
:
Redraw
.
Basic
;
...
...
@@ -475,7 +492,7 @@ class ResourceLabelWidget extends IconLabel {
this
.
needsRedraw
=
Redraw
.
Full
;
}
return
;
return
false
;
}
if
(
this
.
label
)
{
...
...
@@ -492,7 +509,7 @@ class ResourceLabelWidget extends IconLabel {
}
if
(
!
this
.
label
)
{
return
;
return
false
;
}
this
.
renderDisposables
.
clear
();
...
...
@@ -558,6 +575,8 @@ class ResourceLabelWidget extends IconLabel {
this
.
setLabel
(
label
||
''
,
this
.
label
.
description
,
iconLabelOptions
);
this
.
_onDidRender
.
fire
();
return
true
;
}
dispose
():
void
{
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
b069dbe0
...
...
@@ -129,6 +129,9 @@ export class TabsTitleControl extends TitleControl {
// If we are connected to remote, this accounts for the
// remote OS.
(
async
()
=>
this
.
path
=
await
this
.
pathService
.
path
)();
// React to decorations changing for our resource labels
this
.
_register
(
this
.
tabResourceLabels
.
onDidChangeDecorations
(()
=>
this
.
doHandleDecorationsChange
()));
}
protected
create
(
parent
:
HTMLElement
):
void
{
...
...
@@ -161,7 +164,7 @@ export class TabsTitleControl extends TitleControl {
// Editor Actions Toolbar
this
.
createEditorActionsToolBar
(
this
.
editorToolbarContainer
);
// Breadcrumbs
(are on a separate row below tabs and actions)
// Breadcrumbs
const
breadcrumbsContainer
=
document
.
createElement
(
'
div
'
);
breadcrumbsContainer
.
classList
.
add
(
'
tabs-breadcrumbs
'
);
this
.
titleContainer
.
appendChild
(
breadcrumbsContainer
);
...
...
@@ -380,6 +383,13 @@ export class TabsTitleControl extends TitleControl {
}));
}
private
doHandleDecorationsChange
():
void
{
// A change to decorations potentially has an impact on the size of tabs
// so we need to trigger a layout in that case to adjust things
this
.
layout
(
this
.
dimensions
);
}
protected
updateEditorActionsToolbar
():
void
{
super
.
updateEditorActionsToolbar
();
...
...
@@ -611,7 +621,6 @@ export class TabsTitleControl extends TitleControl {
// Tab Editor Label
const
editorLabel
=
this
.
tabResourceLabels
.
create
(
tabContainer
);
const
editorLabelRenderDisposable
=
editorLabel
.
onDidRender
(()
=>
this
.
layout
(
this
.
dimensions
));
// Tab Actions
const
tabActionsContainer
=
document
.
createElement
(
'
div
'
);
...
...
@@ -637,7 +646,7 @@ export class TabsTitleControl extends TitleControl {
// Eventing
const
eventsDisposable
=
this
.
registerTabListeners
(
tabContainer
,
index
,
tabsContainer
,
tabsScrollbar
);
this
.
tabDisposables
.
push
(
combinedDisposable
(
eventsDisposable
,
tabActionBarDisposable
,
tabActionRunner
,
editorLabel
,
editorLabelRenderDisposable
));
this
.
tabDisposables
.
push
(
combinedDisposable
(
eventsDisposable
,
tabActionBarDisposable
,
tabActionRunner
,
editorLabel
));
return
tabContainer
;
}
...
...
src/vs/workbench/browser/parts/editor/titleControl.ts
浏览文件 @
b069dbe0
...
...
@@ -109,7 +109,7 @@ export abstract class TitleControl extends Themable {
this
.
registerListeners
();
}
pr
otected
registerListeners
():
void
{
pr
ivate
registerListeners
():
void
{
// Update actions toolbar when extension register that may contribute them
this
.
_register
(
this
.
extensionService
.
onDidRegisterExtensions
(()
=>
this
.
updateEditorActionsToolbar
()));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录