Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8411186e
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,发现更多精彩内容 >>
未验证
提交
8411186e
编写于
5月 25, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
3a26c32c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
99 addition
and
100 deletion
+99
-100
src/vs/editor/browser/view/viewImpl.ts
src/vs/editor/browser/view/viewImpl.ts
+99
-100
未找到文件。
src/vs/editor/browser/view/viewImpl.ts
浏览文件 @
8411186e
...
...
@@ -63,27 +63,27 @@ export interface IOverlayWidgetData {
export
class
View
extends
ViewEventHandler
{
private
_scrollbar
:
EditorScrollbar
;
private
readonly
_scrollbar
:
EditorScrollbar
;
private
readonly
_context
:
ViewContext
;
private
_selections
:
Selection
[];
// The view lines
private
viewLines
:
ViewLines
;
private
readonly
_
viewLines
:
ViewLines
;
// These are parts, but we must do some API related calls on them, so we keep a reference
private
viewZones
:
ViewZones
;
private
contentWidgets
:
ViewContentWidgets
;
private
overlayWidgets
:
ViewOverlayWidgets
;
private
viewCursors
:
ViewCursors
;
private
viewParts
:
ViewPart
[];
private
readonly
_
viewZones
:
ViewZones
;
private
readonly
_
contentWidgets
:
ViewContentWidgets
;
private
readonly
_
overlayWidgets
:
ViewOverlayWidgets
;
private
readonly
_
viewCursors
:
ViewCursors
;
private
readonly
_
viewParts
:
ViewPart
[];
private
readonly
_textAreaHandler
:
TextAreaHandler
;
private
readonly
pointerHandler
:
PointerHandler
;
private
readonly
_
pointerHandler
:
PointerHandler
;
// Dom nodes
private
linesContent
:
FastDomNode
<
HTMLElement
>
;
public
domNode
:
FastDomNode
<
HTMLElement
>
;
private
overflowGuardContainer
:
FastDomNode
<
HTMLElement
>
;
private
readonly
_
linesContent
:
FastDomNode
<
HTMLElement
>
;
public
readonly
domNode
:
FastDomNode
<
HTMLElement
>
;
private
readonly
_
overflowGuardContainer
:
FastDomNode
<
HTMLElement
>
;
// Actual mutable state
private
_renderAnimationFrame
:
IDisposable
|
null
;
...
...
@@ -113,53 +113,53 @@ export class View extends ViewEventHandler {
this
.
render
(
true
,
false
);
}));
this
.
viewParts
=
[];
this
.
_
viewParts
=
[];
// Keyboard handler
this
.
_textAreaHandler
=
new
TextAreaHandler
(
this
.
_context
,
viewController
,
this
.
createTextAreaHandlerHelper
());
this
.
viewParts
.
push
(
this
.
_textAreaHandler
);
this
.
_textAreaHandler
=
new
TextAreaHandler
(
this
.
_context
,
viewController
,
this
.
_
createTextAreaHandlerHelper
());
this
.
_
viewParts
.
push
(
this
.
_textAreaHandler
);
// These two dom nodes must be constructed up front, since references are needed in the layout provider (scrolling & co.)
this
.
linesContent
=
createFastDomNode
(
document
.
createElement
(
'
div
'
));
this
.
linesContent
.
setClassName
(
'
lines-content
'
+
'
monaco-editor-background
'
);
this
.
linesContent
.
setPosition
(
'
absolute
'
);
this
.
_
linesContent
=
createFastDomNode
(
document
.
createElement
(
'
div
'
));
this
.
_
linesContent
.
setClassName
(
'
lines-content
'
+
'
monaco-editor-background
'
);
this
.
_
linesContent
.
setPosition
(
'
absolute
'
);
this
.
domNode
=
createFastDomNode
(
document
.
createElement
(
'
div
'
));
this
.
domNode
.
setClassName
(
this
.
getEditorClassName
());
this
.
domNode
.
setClassName
(
this
.
_
getEditorClassName
());
// Set role 'code' for better screen reader support https://github.com/microsoft/vscode/issues/93438
this
.
domNode
.
setAttribute
(
'
role
'
,
'
code
'
);
this
.
overflowGuardContainer
=
createFastDomNode
(
document
.
createElement
(
'
div
'
));
PartFingerprints
.
write
(
this
.
overflowGuardContainer
,
PartFingerprint
.
OverflowGuard
);
this
.
overflowGuardContainer
.
setClassName
(
'
overflow-guard
'
);
this
.
_
overflowGuardContainer
=
createFastDomNode
(
document
.
createElement
(
'
div
'
));
PartFingerprints
.
write
(
this
.
_
overflowGuardContainer
,
PartFingerprint
.
OverflowGuard
);
this
.
_
overflowGuardContainer
.
setClassName
(
'
overflow-guard
'
);
this
.
_scrollbar
=
new
EditorScrollbar
(
this
.
_context
,
this
.
linesContent
,
this
.
domNode
,
this
.
overflowGuardContainer
);
this
.
viewParts
.
push
(
this
.
_scrollbar
);
this
.
_scrollbar
=
new
EditorScrollbar
(
this
.
_context
,
this
.
_linesContent
,
this
.
domNode
,
this
.
_
overflowGuardContainer
);
this
.
_
viewParts
.
push
(
this
.
_scrollbar
);
// View Lines
this
.
viewLines
=
new
ViewLines
(
this
.
_context
,
this
.
linesContent
);
this
.
_viewLines
=
new
ViewLines
(
this
.
_context
,
this
.
_
linesContent
);
// View Zones
this
.
viewZones
=
new
ViewZones
(
this
.
_context
);
this
.
viewParts
.
push
(
this
.
viewZones
);
this
.
_
viewZones
=
new
ViewZones
(
this
.
_context
);
this
.
_viewParts
.
push
(
this
.
_
viewZones
);
// Decorations overview ruler
const
decorationsOverviewRuler
=
new
DecorationsOverviewRuler
(
this
.
_context
);
this
.
viewParts
.
push
(
decorationsOverviewRuler
);
this
.
_
viewParts
.
push
(
decorationsOverviewRuler
);
const
scrollDecoration
=
new
ScrollDecorationViewPart
(
this
.
_context
);
this
.
viewParts
.
push
(
scrollDecoration
);
this
.
_
viewParts
.
push
(
scrollDecoration
);
const
contentViewOverlays
=
new
ContentViewOverlays
(
this
.
_context
);
this
.
viewParts
.
push
(
contentViewOverlays
);
this
.
_
viewParts
.
push
(
contentViewOverlays
);
contentViewOverlays
.
addDynamicOverlay
(
new
CurrentLineHighlightOverlay
(
this
.
_context
));
contentViewOverlays
.
addDynamicOverlay
(
new
SelectionsOverlay
(
this
.
_context
));
contentViewOverlays
.
addDynamicOverlay
(
new
IndentGuidesOverlay
(
this
.
_context
));
contentViewOverlays
.
addDynamicOverlay
(
new
DecorationsOverlay
(
this
.
_context
));
const
marginViewOverlays
=
new
MarginViewOverlays
(
this
.
_context
);
this
.
viewParts
.
push
(
marginViewOverlays
);
this
.
_
viewParts
.
push
(
marginViewOverlays
);
marginViewOverlays
.
addDynamicOverlay
(
new
CurrentLineMarginHighlightOverlay
(
this
.
_context
));
marginViewOverlays
.
addDynamicOverlay
(
new
GlyphMarginOverlay
(
this
.
_context
));
marginViewOverlays
.
addDynamicOverlay
(
new
MarginViewLineDecorationsOverlay
(
this
.
_context
));
...
...
@@ -167,26 +167,26 @@ export class View extends ViewEventHandler {
marginViewOverlays
.
addDynamicOverlay
(
new
LineNumbersOverlay
(
this
.
_context
));
const
margin
=
new
Margin
(
this
.
_context
);
margin
.
getDomNode
().
appendChild
(
this
.
viewZones
.
marginDomNode
);
margin
.
getDomNode
().
appendChild
(
this
.
_
viewZones
.
marginDomNode
);
margin
.
getDomNode
().
appendChild
(
marginViewOverlays
.
getDomNode
());
this
.
viewParts
.
push
(
margin
);
this
.
_
viewParts
.
push
(
margin
);
// Content widgets
this
.
contentWidgets
=
new
ViewContentWidgets
(
this
.
_context
,
this
.
domNode
);
this
.
viewParts
.
push
(
this
.
contentWidgets
);
this
.
_
contentWidgets
=
new
ViewContentWidgets
(
this
.
_context
,
this
.
domNode
);
this
.
_viewParts
.
push
(
this
.
_
contentWidgets
);
this
.
viewCursors
=
new
ViewCursors
(
this
.
_context
);
this
.
viewParts
.
push
(
this
.
viewCursors
);
this
.
_
viewCursors
=
new
ViewCursors
(
this
.
_context
);
this
.
_viewParts
.
push
(
this
.
_
viewCursors
);
// Overlay widgets
this
.
overlayWidgets
=
new
ViewOverlayWidgets
(
this
.
_context
);
this
.
viewParts
.
push
(
this
.
overlayWidgets
);
this
.
_
overlayWidgets
=
new
ViewOverlayWidgets
(
this
.
_context
);
this
.
_viewParts
.
push
(
this
.
_
overlayWidgets
);
const
rulers
=
new
Rulers
(
this
.
_context
);
this
.
viewParts
.
push
(
rulers
);
this
.
_
viewParts
.
push
(
rulers
);
const
minimap
=
new
Minimap
(
this
.
_context
);
this
.
viewParts
.
push
(
minimap
);
this
.
_
viewParts
.
push
(
minimap
);
// -------------- Wire dom nodes up
...
...
@@ -195,74 +195,74 @@ export class View extends ViewEventHandler {
overviewRulerData
.
parent
.
insertBefore
(
decorationsOverviewRuler
.
getDomNode
(),
overviewRulerData
.
insertBefore
);
}
this
.
linesContent
.
appendChild
(
contentViewOverlays
.
getDomNode
());
this
.
linesContent
.
appendChild
(
rulers
.
domNode
);
this
.
linesContent
.
appendChild
(
this
.
viewZones
.
domNode
);
this
.
linesContent
.
appendChild
(
this
.
viewLines
.
getDomNode
());
this
.
linesContent
.
appendChild
(
this
.
contentWidgets
.
domNode
);
this
.
linesContent
.
appendChild
(
this
.
viewCursors
.
getDomNode
());
this
.
overflowGuardContainer
.
appendChild
(
margin
.
getDomNode
());
this
.
overflowGuardContainer
.
appendChild
(
this
.
_scrollbar
.
getDomNode
());
this
.
overflowGuardContainer
.
appendChild
(
scrollDecoration
.
getDomNode
());
this
.
overflowGuardContainer
.
appendChild
(
this
.
_textAreaHandler
.
textArea
);
this
.
overflowGuardContainer
.
appendChild
(
this
.
_textAreaHandler
.
textAreaCover
);
this
.
overflowGuardContainer
.
appendChild
(
this
.
overlayWidgets
.
getDomNode
());
this
.
overflowGuardContainer
.
appendChild
(
minimap
.
getDomNode
());
this
.
domNode
.
appendChild
(
this
.
overflowGuardContainer
);
this
.
domNode
.
appendChild
(
this
.
contentWidgets
.
overflowingContentWidgetsDomNode
);
this
.
_
linesContent
.
appendChild
(
contentViewOverlays
.
getDomNode
());
this
.
_
linesContent
.
appendChild
(
rulers
.
domNode
);
this
.
_linesContent
.
appendChild
(
this
.
_
viewZones
.
domNode
);
this
.
_linesContent
.
appendChild
(
this
.
_
viewLines
.
getDomNode
());
this
.
_linesContent
.
appendChild
(
this
.
_
contentWidgets
.
domNode
);
this
.
_linesContent
.
appendChild
(
this
.
_
viewCursors
.
getDomNode
());
this
.
_
overflowGuardContainer
.
appendChild
(
margin
.
getDomNode
());
this
.
_
overflowGuardContainer
.
appendChild
(
this
.
_scrollbar
.
getDomNode
());
this
.
_
overflowGuardContainer
.
appendChild
(
scrollDecoration
.
getDomNode
());
this
.
_
overflowGuardContainer
.
appendChild
(
this
.
_textAreaHandler
.
textArea
);
this
.
_
overflowGuardContainer
.
appendChild
(
this
.
_textAreaHandler
.
textAreaCover
);
this
.
_overflowGuardContainer
.
appendChild
(
this
.
_
overlayWidgets
.
getDomNode
());
this
.
_
overflowGuardContainer
.
appendChild
(
minimap
.
getDomNode
());
this
.
domNode
.
appendChild
(
this
.
_
overflowGuardContainer
);
this
.
domNode
.
appendChild
(
this
.
_
contentWidgets
.
overflowingContentWidgetsDomNode
);
this
.
_applyLayout
();
// Pointer handler
this
.
pointerHandler
=
this
.
_register
(
new
PointerHandler
(
this
.
_context
,
viewController
,
this
.
createPointerHandlerHelper
()));
this
.
_pointerHandler
=
this
.
_register
(
new
PointerHandler
(
this
.
_context
,
viewController
,
this
.
_
createPointerHandlerHelper
()));
}
private
_flushAccumulatedAndRenderNow
():
void
{
this
.
_renderNow
();
}
private
createPointerHandlerHelper
():
IPointerHandlerHelper
{
private
_
createPointerHandlerHelper
():
IPointerHandlerHelper
{
return
{
viewDomNode
:
this
.
domNode
.
domNode
,
linesContentDomNode
:
this
.
linesContent
.
domNode
,
linesContentDomNode
:
this
.
_
linesContent
.
domNode
,
focusTextArea
:
()
=>
{
this
.
focus
();
},
getLastRenderData
:
():
PointerHandlerLastRenderData
=>
{
const
lastViewCursorsRenderData
=
this
.
viewCursors
.
getLastRenderData
()
||
[];
const
lastViewCursorsRenderData
=
this
.
_
viewCursors
.
getLastRenderData
()
||
[];
const
lastTextareaPosition
=
this
.
_textAreaHandler
.
getLastRenderData
();
return
new
PointerHandlerLastRenderData
(
lastViewCursorsRenderData
,
lastTextareaPosition
);
},
shouldSuppressMouseDownOnViewZone
:
(
viewZoneId
:
string
)
=>
{
return
this
.
viewZones
.
shouldSuppressMouseDownOnViewZone
(
viewZoneId
);
return
this
.
_
viewZones
.
shouldSuppressMouseDownOnViewZone
(
viewZoneId
);
},
shouldSuppressMouseDownOnWidget
:
(
widgetId
:
string
)
=>
{
return
this
.
contentWidgets
.
shouldSuppressMouseDownOnWidget
(
widgetId
);
return
this
.
_
contentWidgets
.
shouldSuppressMouseDownOnWidget
(
widgetId
);
},
getPositionFromDOMInfo
:
(
spanNode
:
HTMLElement
,
offset
:
number
)
=>
{
this
.
_flushAccumulatedAndRenderNow
();
return
this
.
viewLines
.
getPositionFromDOMInfo
(
spanNode
,
offset
);
return
this
.
_
viewLines
.
getPositionFromDOMInfo
(
spanNode
,
offset
);
},
visibleRangeForPosition
:
(
lineNumber
:
number
,
column
:
number
)
=>
{
this
.
_flushAccumulatedAndRenderNow
();
return
this
.
viewLines
.
visibleRangeForPosition
(
new
Position
(
lineNumber
,
column
));
return
this
.
_
viewLines
.
visibleRangeForPosition
(
new
Position
(
lineNumber
,
column
));
},
getLineWidth
:
(
lineNumber
:
number
)
=>
{
this
.
_flushAccumulatedAndRenderNow
();
return
this
.
viewLines
.
getLineWidth
(
lineNumber
);
return
this
.
_
viewLines
.
getLineWidth
(
lineNumber
);
}
};
}
private
createTextAreaHandlerHelper
():
ITextAreaHandlerHelper
{
private
_
createTextAreaHandlerHelper
():
ITextAreaHandlerHelper
{
return
{
visibleRangeForPositionRelativeToEditor
:
(
lineNumber
:
number
,
column
:
number
)
=>
{
this
.
_flushAccumulatedAndRenderNow
();
return
this
.
viewLines
.
visibleRangeForPosition
(
new
Position
(
lineNumber
,
column
));
return
this
.
_
viewLines
.
visibleRangeForPosition
(
new
Position
(
lineNumber
,
column
));
}
};
}
...
...
@@ -274,14 +274,14 @@ export class View extends ViewEventHandler {
this
.
domNode
.
setWidth
(
layoutInfo
.
width
);
this
.
domNode
.
setHeight
(
layoutInfo
.
height
);
this
.
overflowGuardContainer
.
setWidth
(
layoutInfo
.
width
);
this
.
overflowGuardContainer
.
setHeight
(
layoutInfo
.
height
);
this
.
_
overflowGuardContainer
.
setWidth
(
layoutInfo
.
width
);
this
.
_
overflowGuardContainer
.
setHeight
(
layoutInfo
.
height
);
this
.
linesContent
.
setWidth
(
1000000
);
this
.
linesContent
.
setHeight
(
1000000
);
this
.
_
linesContent
.
setWidth
(
1000000
);
this
.
_
linesContent
.
setHeight
(
1000000
);
}
private
getEditorClassName
()
{
private
_
getEditorClassName
()
{
const
focused
=
this
.
_textAreaHandler
.
isFocused
()
?
'
focused
'
:
''
;
return
this
.
_context
.
configuration
.
options
.
get
(
EditorOption
.
editorClassName
)
+
'
'
+
getThemeTypeSelector
(
this
.
_context
.
theme
.
type
)
+
focused
;
}
...
...
@@ -292,7 +292,7 @@ export class View extends ViewEventHandler {
this
.
_scheduleRender
();
}
public
onConfigurationChanged
(
e
:
viewEvents
.
ViewConfigurationChangedEvent
):
boolean
{
this
.
domNode
.
setClassName
(
this
.
getEditorClassName
());
this
.
domNode
.
setClassName
(
this
.
_
getEditorClassName
());
this
.
_applyLayout
();
return
false
;
}
...
...
@@ -301,11 +301,11 @@ export class View extends ViewEventHandler {
return
false
;
}
public
onFocusChanged
(
e
:
viewEvents
.
ViewFocusChangedEvent
):
boolean
{
this
.
domNode
.
setClassName
(
this
.
getEditorClassName
());
this
.
domNode
.
setClassName
(
this
.
_
getEditorClassName
());
return
false
;
}
public
onThemeChanged
(
e
:
viewEvents
.
ViewThemeChangedEvent
):
boolean
{
this
.
domNode
.
setClassName
(
this
.
getEditorClassName
());
this
.
domNode
.
setClassName
(
this
.
_
getEditorClassName
());
return
false
;
}
...
...
@@ -319,13 +319,12 @@ export class View extends ViewEventHandler {
this
.
_context
.
removeEventHandler
(
this
);
this
.
viewLines
.
dispose
();
this
.
_
viewLines
.
dispose
();
// Destroy view parts
for
(
let
i
=
0
,
len
=
this
.
viewParts
.
length
;
i
<
len
;
i
++
)
{
this
.
viewParts
[
i
].
dispose
();
for
(
let
i
=
0
,
len
=
this
.
_
viewParts
.
length
;
i
<
len
;
i
++
)
{
this
.
_
viewParts
[
i
].
dispose
();
}
this
.
viewParts
=
[];
super
.
dispose
();
}
...
...
@@ -347,8 +346,8 @@ export class View extends ViewEventHandler {
private
_getViewPartsToRender
():
ViewPart
[]
{
let
result
:
ViewPart
[]
=
[],
resultLen
=
0
;
for
(
let
i
=
0
,
len
=
this
.
viewParts
.
length
;
i
<
len
;
i
++
)
{
const
viewPart
=
this
.
viewParts
[
i
];
for
(
let
i
=
0
,
len
=
this
.
_
viewParts
.
length
;
i
<
len
;
i
++
)
{
const
viewPart
=
this
.
_
viewParts
[
i
];
if
(
viewPart
.
shouldRender
())
{
result
[
resultLen
++
]
=
viewPart
;
}
...
...
@@ -363,7 +362,7 @@ export class View extends ViewEventHandler {
let
viewPartsToRender
=
this
.
_getViewPartsToRender
();
if
(
!
this
.
viewLines
.
shouldRender
()
&&
viewPartsToRender
.
length
===
0
)
{
if
(
!
this
.
_
viewLines
.
shouldRender
()
&&
viewPartsToRender
.
length
===
0
)
{
// Nothing to render
return
;
}
...
...
@@ -378,20 +377,20 @@ export class View extends ViewEventHandler {
this
.
_context
.
model
);
if
(
this
.
contentWidgets
.
shouldRender
())
{
if
(
this
.
_
contentWidgets
.
shouldRender
())
{
// Give the content widgets a chance to set their max width before a possible synchronous layout
this
.
contentWidgets
.
onBeforeRender
(
viewportData
);
this
.
_
contentWidgets
.
onBeforeRender
(
viewportData
);
}
if
(
this
.
viewLines
.
shouldRender
())
{
this
.
viewLines
.
renderText
(
viewportData
);
this
.
viewLines
.
onDidRender
();
if
(
this
.
_
viewLines
.
shouldRender
())
{
this
.
_
viewLines
.
renderText
(
viewportData
);
this
.
_
viewLines
.
onDidRender
();
// Rendering of viewLines might cause scroll events to occur, so collect view parts to render again
viewPartsToRender
=
this
.
_getViewPartsToRender
();
}
const
renderingContext
=
new
RenderingContext
(
this
.
_context
.
viewLayout
,
viewportData
,
this
.
viewLines
);
const
renderingContext
=
new
RenderingContext
(
this
.
_context
.
viewLayout
,
viewportData
,
this
.
_
viewLines
);
// Render the rest of the parts
for
(
let
i
=
0
,
len
=
viewPartsToRender
.
length
;
i
<
len
;
i
++
)
{
...
...
@@ -416,7 +415,7 @@ export class View extends ViewEventHandler {
this
.
_context
.
model
.
setScrollPosition
({
scrollTop
:
scrollPosition
.
scrollTop
},
ScrollType
.
Immediate
);
this
.
_context
.
model
.
tokenizeViewport
();
this
.
_renderNow
();
this
.
viewLines
.
updateLineWidths
();
this
.
_
viewLines
.
updateLineWidths
();
this
.
_context
.
model
.
setScrollPosition
({
scrollLeft
:
scrollPosition
.
scrollLeft
},
ScrollType
.
Immediate
);
}
...
...
@@ -427,7 +426,7 @@ export class View extends ViewEventHandler {
});
const
viewPosition
=
this
.
_context
.
model
.
coordinatesConverter
.
convertModelPositionToViewPosition
(
modelPosition
);
this
.
_flushAccumulatedAndRenderNow
();
const
visibleRange
=
this
.
viewLines
.
visibleRangeForPosition
(
new
Position
(
viewPosition
.
lineNumber
,
viewPosition
.
column
));
const
visibleRange
=
this
.
_
viewLines
.
visibleRangeForPosition
(
new
Position
(
viewPosition
.
lineNumber
,
viewPosition
.
column
));
if
(
!
visibleRange
)
{
return
-
1
;
}
...
...
@@ -435,7 +434,7 @@ export class View extends ViewEventHandler {
}
public
getTargetAtClientPoint
(
clientX
:
number
,
clientY
:
number
):
IMouseTarget
|
null
{
const
mouseTarget
=
this
.
pointerHandler
.
getTargetAtClientPoint
(
clientX
,
clientY
);
const
mouseTarget
=
this
.
_
pointerHandler
.
getTargetAtClientPoint
(
clientX
,
clientY
);
if
(
!
mouseTarget
)
{
return
null
;
}
...
...
@@ -447,16 +446,16 @@ export class View extends ViewEventHandler {
}
public
change
(
callback
:
(
changeAccessor
:
IViewZoneChangeAccessor
)
=>
any
):
void
{
this
.
viewZones
.
changeViewZones
(
callback
);
this
.
_
viewZones
.
changeViewZones
(
callback
);
this
.
_scheduleRender
();
}
public
render
(
now
:
boolean
,
everything
:
boolean
):
void
{
if
(
everything
)
{
// Force everything to render...
this
.
viewLines
.
forceShouldRender
();
for
(
let
i
=
0
,
len
=
this
.
viewParts
.
length
;
i
<
len
;
i
++
)
{
const
viewPart
=
this
.
viewParts
[
i
];
this
.
_
viewLines
.
forceShouldRender
();
for
(
let
i
=
0
,
len
=
this
.
_
viewParts
.
length
;
i
<
len
;
i
++
)
{
const
viewPart
=
this
.
_
viewParts
[
i
];
viewPart
.
forceShouldRender
();
}
}
...
...
@@ -484,7 +483,7 @@ export class View extends ViewEventHandler {
}
public
addContentWidget
(
widgetData
:
IContentWidgetData
):
void
{
this
.
contentWidgets
.
addWidget
(
widgetData
.
widget
);
this
.
_
contentWidgets
.
addWidget
(
widgetData
.
widget
);
this
.
layoutContentWidget
(
widgetData
);
this
.
_scheduleRender
();
}
...
...
@@ -498,31 +497,31 @@ export class View extends ViewEventHandler {
}
}
const
newPreference
=
widgetData
.
position
?
widgetData
.
position
.
preference
:
null
;
this
.
contentWidgets
.
setWidgetPosition
(
widgetData
.
widget
,
newRange
,
newPreference
);
this
.
_
contentWidgets
.
setWidgetPosition
(
widgetData
.
widget
,
newRange
,
newPreference
);
this
.
_scheduleRender
();
}
public
removeContentWidget
(
widgetData
:
IContentWidgetData
):
void
{
this
.
contentWidgets
.
removeWidget
(
widgetData
.
widget
);
this
.
_
contentWidgets
.
removeWidget
(
widgetData
.
widget
);
this
.
_scheduleRender
();
}
public
addOverlayWidget
(
widgetData
:
IOverlayWidgetData
):
void
{
this
.
overlayWidgets
.
addWidget
(
widgetData
.
widget
);
this
.
_
overlayWidgets
.
addWidget
(
widgetData
.
widget
);
this
.
layoutOverlayWidget
(
widgetData
);
this
.
_scheduleRender
();
}
public
layoutOverlayWidget
(
widgetData
:
IOverlayWidgetData
):
void
{
const
newPreference
=
widgetData
.
position
?
widgetData
.
position
.
preference
:
null
;
const
shouldRender
=
this
.
overlayWidgets
.
setWidgetPosition
(
widgetData
.
widget
,
newPreference
);
const
shouldRender
=
this
.
_
overlayWidgets
.
setWidgetPosition
(
widgetData
.
widget
,
newPreference
);
if
(
shouldRender
)
{
this
.
_scheduleRender
();
}
}
public
removeOverlayWidget
(
widgetData
:
IOverlayWidgetData
):
void
{
this
.
overlayWidgets
.
removeWidget
(
widgetData
.
widget
);
this
.
_
overlayWidgets
.
removeWidget
(
widgetData
.
widget
);
this
.
_scheduleRender
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录