Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5eff1e2e
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,发现更多精彩内容 >>
提交
5eff1e2e
编写于
12月 20, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
views - adopt new visibility event (part of #65475)
上级
cdb8a86f
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
119 addition
and
220 deletion
+119
-220
src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts
...orkbench/parts/comments/electron-browser/commentsPanel.ts
+9
-15
src/vs/workbench/parts/debug/browser/breakpointsView.ts
src/vs/workbench/parts/debug/browser/breakpointsView.ts
+6
-16
src/vs/workbench/parts/debug/browser/loadedScriptsView.ts
src/vs/workbench/parts/debug/browser/loadedScriptsView.ts
+6
-24
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
...s/workbench/parts/debug/electron-browser/callStackView.ts
+6
-7
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+10
-12
src/vs/workbench/parts/debug/electron-browser/variablesView.ts
...s/workbench/parts/debug/electron-browser/variablesView.ts
+6
-16
src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts
...ench/parts/debug/electron-browser/watchExpressionsView.ts
+6
-16
src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts
...ch/parts/extensions/electron-browser/extensionsViewlet.ts
+5
-9
src/vs/workbench/parts/files/electron-browser/views/emptyView.ts
...workbench/parts/files/electron-browser/views/emptyView.ts
+4
-25
src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts
...nch/parts/files/electron-browser/views/openEditorsView.ts
+7
-18
src/vs/workbench/parts/markers/electron-browser/markersPanel.ts
.../workbench/parts/markers/electron-browser/markersPanel.ts
+10
-14
src/vs/workbench/parts/search/browser/searchView.ts
src/vs/workbench/parts/search/browser/searchView.ts
+26
-26
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+18
-22
未找到文件。
src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts
浏览文件 @
5eff1e2e
...
@@ -62,14 +62,18 @@ export class CommentsPanel extends Panel {
...
@@ -62,14 +62,18 @@ export class CommentsPanel extends Panel {
this
.
createTree
();
this
.
createTree
();
this
.
createMessageBox
(
container
);
this
.
createMessageBox
(
container
);
this
.
commentService
.
onDidSetAllCommentThreads
(
this
.
onAllCommentsChanged
,
this
);
this
.
_register
(
this
.
commentService
.
onDidSetAllCommentThreads
(
this
.
onAllCommentsChanged
,
this
)
);
this
.
commentService
.
onDidUpdateCommentThreads
(
this
.
onCommentsUpdated
,
this
);
this
.
_register
(
this
.
commentService
.
onDidUpdateCommentThreads
(
this
.
onCommentsUpdated
,
this
)
);
const
styleElement
=
dom
.
createStyleSheet
(
parent
);
const
styleElement
=
dom
.
createStyleSheet
(
parent
);
this
.
applyStyles
(
styleElement
);
this
.
applyStyles
(
styleElement
);
this
.
themeService
.
onThemeChange
(
_
=>
{
this
.
_register
(
this
.
themeService
.
onThemeChange
(
_
=>
this
.
applyStyles
(
styleElement
)));
this
.
applyStyles
(
styleElement
);
});
this
.
_register
(
this
.
onDidChangeVisibility
(
visible
=>
{
if
(
visible
)
{
this
.
refresh
();
}
}));
this
.
render
();
this
.
render
();
}
}
...
@@ -232,16 +236,6 @@ export class CommentsPanel extends Panel {
...
@@ -232,16 +236,6 @@ export class CommentsPanel extends Panel {
return
true
;
return
true
;
}
}
public
setVisible
(
visible
:
boolean
):
void
{
const
wasVisible
=
this
.
isVisible
();
super
.
setVisible
(
visible
);
if
(
this
.
isVisible
())
{
if
(
!
wasVisible
)
{
this
.
refresh
();
}
}
}
private
refresh
():
void
{
private
refresh
():
void
{
if
(
this
.
isVisible
())
{
if
(
this
.
isVisible
())
{
this
.
collapseAllAction
.
enabled
=
this
.
commentsModel
.
hasCommentThreads
();
this
.
collapseAllAction
.
enabled
=
this
.
commentsModel
.
hasCommentThreads
();
...
...
src/vs/workbench/parts/debug/browser/breakpointsView.ts
浏览文件 @
5eff1e2e
...
@@ -119,6 +119,12 @@ export class BreakpointsView extends ViewletPanel {
...
@@ -119,6 +119,12 @@ export class BreakpointsView extends ViewletPanel {
}));
}));
this
.
list
.
splice
(
0
,
this
.
list
.
length
,
this
.
elements
);
this
.
list
.
splice
(
0
,
this
.
list
.
length
,
this
.
elements
);
this
.
disposables
.
push
(
this
.
onDidChangeBodyVisibility
(
visible
=>
{
if
(
visible
&&
this
.
needsRefresh
)
{
this
.
onBreakpointsChange
();
}
}));
}
}
public
focus
():
void
{
public
focus
():
void
{
...
@@ -191,22 +197,6 @@ export class BreakpointsView extends ViewletPanel {
...
@@ -191,22 +197,6 @@ export class BreakpointsView extends ViewletPanel {
];
];
}
}
public
setExpanded
(
expanded
:
boolean
):
boolean
{
const
changed
=
super
.
setExpanded
(
expanded
);
if
(
expanded
&&
this
.
needsRefresh
)
{
this
.
onBreakpointsChange
();
}
return
changed
;
}
public
setVisible
(
visible
:
boolean
):
void
{
super
.
setVisible
(
visible
);
if
(
visible
&&
this
.
needsRefresh
)
{
this
.
onBreakpointsChange
();
}
}
private
onBreakpointsChange
():
void
{
private
onBreakpointsChange
():
void
{
if
(
this
.
isExpanded
()
&&
this
.
isVisible
())
{
if
(
this
.
isExpanded
()
&&
this
.
isVisible
())
{
this
.
minimumBodySize
=
this
.
getExpandedBodySize
();
this
.
minimumBodySize
=
this
.
getExpandedBodySize
();
...
...
src/vs/workbench/parts/debug/browser/loadedScriptsView.ts
浏览文件 @
5eff1e2e
...
@@ -492,35 +492,17 @@ export class LoadedScriptsView extends ViewletPanel {
...
@@ -492,35 +492,17 @@ export class LoadedScriptsView extends ViewletPanel {
}));
}));
this
.
changeScheduler
.
schedule
(
0
);
this
.
changeScheduler
.
schedule
(
0
);
}
layoutBody
(
size
:
number
):
void
{
this
.
disposables
.
push
(
this
.
onDidChangeBodyVisibility
(
visible
=>
{
this
.
tree
.
layout
(
size
);
}
setExpanded
(
expanded
:
boolean
):
boolean
{
const
changed
=
super
.
setExpanded
(
expanded
);
if
(
expanded
&&
this
.
treeNeedsRefreshOnVisible
)
{
this
.
changeScheduler
.
schedule
();
}
return
changed
;
}
setVisible
(
visible
:
boolean
):
void
{
super
.
setVisible
(
visible
);
if
(
visible
&&
this
.
treeNeedsRefreshOnVisible
)
{
if
(
visible
&&
this
.
treeNeedsRefreshOnVisible
)
{
this
.
changeScheduler
.
schedule
();
this
.
changeScheduler
.
schedule
();
}
}
}));
}
}
/*
layoutBody
(
size
:
number
):
void
{
private tryToExpand(element: LoadedScriptsItem): void {
this
.
tree
.
layout
(
size
);
try {
this.tree.expand(element);
} catch (e) { }
}
}
*/
dispose
():
void
{
dispose
():
void
{
this
.
tree
=
dispose
(
this
.
tree
);
this
.
tree
=
dispose
(
this
.
tree
);
...
...
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
浏览文件 @
5eff1e2e
...
@@ -215,6 +215,12 @@ export class CallStackView extends ViewletPanel {
...
@@ -215,6 +215,12 @@ export class CallStackView extends ViewletPanel {
if
(
this
.
debugService
.
state
===
State
.
Stopped
)
{
if
(
this
.
debugService
.
state
===
State
.
Stopped
)
{
this
.
onCallStackChangeScheduler
.
schedule
(
0
);
this
.
onCallStackChangeScheduler
.
schedule
(
0
);
}
}
this
.
disposables
.
push
(
this
.
onDidChangeBodyVisibility
(
visible
=>
{
if
(
visible
&&
this
.
needsRefresh
)
{
this
.
onCallStackChangeScheduler
.
schedule
();
}
}));
}
}
layoutBody
(
size
:
number
):
void
{
layoutBody
(
size
:
number
):
void
{
...
@@ -256,13 +262,6 @@ export class CallStackView extends ViewletPanel {
...
@@ -256,13 +262,6 @@ export class CallStackView extends ViewletPanel {
}
}
}
}
setVisible
(
visible
:
boolean
):
void
{
super
.
setVisible
(
visible
);
if
(
visible
&&
this
.
needsRefresh
)
{
this
.
onCallStackChangeScheduler
.
schedule
();
}
}
private
onContextMenu
(
e
:
ITreeContextMenuEvent
<
CallStackItem
>
):
void
{
private
onContextMenu
(
e
:
ITreeContextMenuEvent
<
CallStackItem
>
):
void
{
const
actions
:
IAction
[]
=
[];
const
actions
:
IAction
[]
=
[];
const
element
=
e
.
element
;
const
element
=
e
.
element
;
...
...
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
5eff1e2e
...
@@ -149,10 +149,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
...
@@ -149,10 +149,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
this
.
updateInputDecoration
();
this
.
updateInputDecoration
();
}
}
}));
}));
}
this
.
_register
(
this
.
onDidChangeVisibility
(
visible
=>
{
setVisible
(
visible
:
boolean
):
void
{
super
.
setVisible
(
visible
);
if
(
!
visible
)
{
if
(
!
visible
)
{
dispose
(
this
.
model
);
dispose
(
this
.
model
);
}
else
{
}
else
{
...
@@ -161,6 +158,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
...
@@ -161,6 +158,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
this
.
updateInputDecoration
();
this
.
updateInputDecoration
();
this
.
refreshReplElements
(
true
);
this
.
refreshReplElements
(
true
);
}
}
}));
}
}
get
isReadonly
():
boolean
{
get
isReadonly
():
boolean
{
...
...
src/vs/workbench/parts/debug/electron-browser/variablesView.ts
浏览文件 @
5eff1e2e
...
@@ -105,26 +105,16 @@ export class VariablesView extends ViewletPanel {
...
@@ -105,26 +105,16 @@ export class VariablesView extends ViewletPanel {
this
.
disposables
.
push
(
variableSetEmitter
.
event
(()
=>
this
.
tree
.
refresh
()));
this
.
disposables
.
push
(
variableSetEmitter
.
event
(()
=>
this
.
tree
.
refresh
()));
this
.
disposables
.
push
(
this
.
tree
.
onMouseDblClick
(
e
=>
this
.
onMouseDblClick
(
e
)));
this
.
disposables
.
push
(
this
.
tree
.
onMouseDblClick
(
e
=>
this
.
onMouseDblClick
(
e
)));
this
.
disposables
.
push
(
this
.
tree
.
onContextMenu
(
e
=>
this
.
onContextMenu
(
e
)));
this
.
disposables
.
push
(
this
.
tree
.
onContextMenu
(
e
=>
this
.
onContextMenu
(
e
)));
}
layoutBody
(
size
:
number
):
void
{
this
.
disposables
.
push
(
this
.
onDidChangeBodyVisibility
(
visible
=>
{
this
.
tree
.
layout
(
size
);
if
(
visible
&&
this
.
needsRefresh
)
{
}
setExpanded
(
expanded
:
boolean
):
boolean
{
const
changed
=
super
.
setExpanded
(
expanded
);
if
(
expanded
&&
this
.
needsRefresh
)
{
this
.
onFocusStackFrameScheduler
.
schedule
();
this
.
onFocusStackFrameScheduler
.
schedule
();
}
}
}));
return
changed
;
}
}
setVisible
(
visible
:
boolean
):
void
{
layoutBody
(
size
:
number
):
void
{
super
.
setVisible
(
visible
);
this
.
tree
.
layout
(
size
);
if
(
visible
&&
this
.
needsRefresh
)
{
this
.
onFocusStackFrameScheduler
.
schedule
();
}
}
}
private
onMouseDblClick
(
e
:
ITreeMouseEvent
<
IExpression
|
IScope
>
):
void
{
private
onMouseDblClick
(
e
:
ITreeMouseEvent
<
IExpression
|
IScope
>
):
void
{
...
...
src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts
浏览文件 @
5eff1e2e
...
@@ -98,26 +98,16 @@ export class WatchExpressionsView extends ViewletPanel {
...
@@ -98,26 +98,16 @@ export class WatchExpressionsView extends ViewletPanel {
}
}
}));
}));
this
.
disposables
.
push
(
variableSetEmitter
.
event
(()
=>
this
.
tree
.
refresh
()));
this
.
disposables
.
push
(
variableSetEmitter
.
event
(()
=>
this
.
tree
.
refresh
()));
}
layoutBody
(
size
:
number
):
void
{
this
.
disposables
.
push
(
this
.
onDidChangeBodyVisibility
(
visible
=>
{
this
.
tree
.
layout
(
size
);
if
(
visible
&&
this
.
needsRefresh
)
{
}
setExpanded
(
expanded
:
boolean
):
boolean
{
const
changed
=
super
.
setExpanded
(
expanded
);
if
(
expanded
&&
this
.
needsRefresh
)
{
this
.
onWatchExpressionsUpdatedScheduler
.
schedule
();
this
.
onWatchExpressionsUpdatedScheduler
.
schedule
();
}
}
}));
return
changed
;
}
}
setVisible
(
visible
:
boolean
):
void
{
layoutBody
(
size
:
number
):
void
{
super
.
setVisible
(
visible
);
this
.
tree
.
layout
(
size
);
if
(
visible
&&
this
.
needsRefresh
)
{
this
.
onWatchExpressionsUpdatedScheduler
.
schedule
();
}
}
}
private
onMouseDblClick
(
e
:
ITreeMouseEvent
<
IExpression
>
):
void
{
private
onMouseDblClick
(
e
:
ITreeMouseEvent
<
IExpression
>
):
void
{
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts
浏览文件 @
5eff1e2e
...
@@ -370,18 +370,14 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
...
@@ -370,18 +370,14 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
this
.
searchBox
.
onShouldFocusResults
(()
=>
this
.
focusListView
(),
this
,
this
.
disposables
);
this
.
searchBox
.
onShouldFocusResults
(()
=>
this
.
focusListView
(),
this
,
this
.
disposables
);
this
.
extensionsBox
=
append
(
this
.
root
,
$
(
'
.extensions
'
));
this
.
_register
(
this
.
onDidChangeVisibility
(
visible
=>
{
super
.
create
(
this
.
extensionsBox
);
}
setVisible
(
visible
:
boolean
):
void
{
const
isVisibilityChanged
=
this
.
isVisible
()
!==
visible
;
super
.
setVisible
(
visible
);
if
(
isVisibilityChanged
)
{
if
(
visible
)
{
if
(
visible
)
{
this
.
searchBox
.
focus
();
this
.
searchBox
.
focus
();
}
}
}
}));
this
.
extensionsBox
=
append
(
this
.
root
,
$
(
'
.extensions
'
));
super
.
create
(
this
.
extensionsBox
);
}
}
focus
():
void
{
focus
():
void
{
...
...
src/vs/workbench/parts/files/electron-browser/views/emptyView.ts
浏览文件 @
5eff1e2e
...
@@ -9,7 +9,6 @@ import * as env from 'vs/base/common/platform';
...
@@ -9,7 +9,6 @@ import * as env from 'vs/base/common/platform';
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
Button
}
from
'
vs/base/browser/ui/button/button
'
;
import
{
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IViewletViewOptions
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
IViewletViewOptions
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
OpenFolderAction
,
OpenFileFolderAction
,
AddRootFolderAction
}
from
'
vs/workbench/browser/actions/workspaceActions
'
;
import
{
OpenFolderAction
,
OpenFileFolderAction
,
AddRootFolderAction
}
from
'
vs/workbench/browser/actions/workspaceActions
'
;
...
@@ -26,8 +25,8 @@ import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
...
@@ -26,8 +25,8 @@ import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
export
class
EmptyView
extends
ViewletPanel
{
export
class
EmptyView
extends
ViewletPanel
{
public
static
readonly
ID
:
string
=
'
workbench.explorer.emptyView
'
;
static
readonly
ID
:
string
=
'
workbench.explorer.emptyView
'
;
public
static
readonly
NAME
=
nls
.
localize
(
'
noWorkspace
'
,
"
No Folder Opened
"
);
static
readonly
NAME
=
nls
.
localize
(
'
noWorkspace
'
,
"
No Folder Opened
"
);
private
button
:
Button
;
private
button
:
Button
;
private
messageElement
:
HTMLElement
;
private
messageElement
:
HTMLElement
;
...
@@ -46,7 +45,7 @@ export class EmptyView extends ViewletPanel {
...
@@ -46,7 +45,7 @@ export class EmptyView extends ViewletPanel {
this
.
contextService
.
onDidChangeWorkbenchState
(()
=>
this
.
setLabels
());
this
.
contextService
.
onDidChangeWorkbenchState
(()
=>
this
.
setLabels
());
}
}
public
renderHeader
(
container
:
HTMLElement
):
void
{
renderHeader
(
container
:
HTMLElement
):
void
{
const
titleContainer
=
document
.
createElement
(
'
div
'
);
const
titleContainer
=
document
.
createElement
(
'
div
'
);
DOM
.
addClass
(
titleContainer
,
'
title
'
);
DOM
.
addClass
(
titleContainer
,
'
title
'
);
container
.
appendChild
(
titleContainer
);
container
.
appendChild
(
titleContainer
);
...
@@ -123,29 +122,9 @@ export class EmptyView extends ViewletPanel {
...
@@ -123,29 +122,9 @@ export class EmptyView extends ViewletPanel {
// no-op
// no-op
}
}
public
setVisible
(
visible
:
boolean
):
Promise
<
void
>
{
focusBody
():
void
{
return
Promise
.
resolve
(
void
0
);
}
public
focusBody
():
void
{
if
(
this
.
button
)
{
if
(
this
.
button
)
{
this
.
button
.
element
.
focus
();
this
.
button
.
element
.
focus
();
}
}
}
}
protected
reveal
(
element
:
any
,
relativeTop
?:
number
):
Promise
<
void
>
{
return
Promise
.
resolve
(
void
0
);
}
public
getActions
():
IAction
[]
{
return
[];
}
public
getSecondaryActions
():
IAction
[]
{
return
[];
}
public
getActionItem
(
action
:
IAction
):
IActionItem
{
return
null
;
}
}
}
src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts
浏览文件 @
5eff1e2e
...
@@ -284,6 +284,13 @@ export class OpenEditorsView extends ViewletPanel {
...
@@ -284,6 +284,13 @@ export class OpenEditorsView extends ViewletPanel {
}));
}));
this
.
listRefreshScheduler
.
schedule
(
0
);
this
.
listRefreshScheduler
.
schedule
(
0
);
this
.
disposables
.
push
(
this
.
onDidChangeBodyVisibility
(
visible
=>
{
this
.
updateListVisibility
(
visible
);
if
(
visible
&&
this
.
needsRefresh
)
{
this
.
listRefreshScheduler
.
schedule
(
0
);
}
}));
}
}
public
getActions
():
IAction
[]
{
public
getActions
():
IAction
[]
{
...
@@ -294,24 +301,6 @@ export class OpenEditorsView extends ViewletPanel {
...
@@ -294,24 +301,6 @@ export class OpenEditorsView extends ViewletPanel {
];
];
}
}
public
setExpanded
(
expanded
:
boolean
):
boolean
{
const
changed
=
super
.
setExpanded
(
expanded
);
this
.
updateListVisibility
(
expanded
);
if
(
expanded
&&
this
.
needsRefresh
)
{
this
.
listRefreshScheduler
.
schedule
(
0
);
}
return
changed
;
}
public
setVisible
(
visible
:
boolean
):
void
{
super
.
setVisible
(
visible
);
this
.
updateListVisibility
(
visible
&&
this
.
isExpanded
());
if
(
visible
&&
this
.
needsRefresh
)
{
this
.
listRefreshScheduler
.
schedule
(
0
);
}
}
public
focus
():
void
{
public
focus
():
void
{
super
.
focus
();
super
.
focus
();
this
.
list
.
domFocus
();
this
.
list
.
domFocus
();
...
...
src/vs/workbench/parts/markers/electron-browser/markersPanel.ts
浏览文件 @
5eff1e2e
...
@@ -130,8 +130,16 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
...
@@ -130,8 +130,16 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
this
.
updateFilter
();
this
.
updateFilter
();
this
.
onDidFocus
(()
=>
this
.
panelFoucusContextKey
.
set
(
true
));
this
.
_register
(
this
.
onDidFocus
(()
=>
this
.
panelFoucusContextKey
.
set
(
true
)));
this
.
onDidBlur
(()
=>
this
.
panelFoucusContextKey
.
set
(
false
));
this
.
_register
(
this
.
onDidBlur
(()
=>
this
.
panelFoucusContextKey
.
set
(
false
)));
this
.
_register
(
this
.
onDidChangeVisibility
(
visible
=>
{
if
(
visible
)
{
this
.
refreshPanel
();
}
else
{
this
.
rangeHighlightDecorations
.
removeHighlightRange
();
}
}));
this
.
render
();
this
.
render
();
}
}
...
@@ -162,18 +170,6 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
...
@@ -162,18 +170,6 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}
}
}
}
public
setVisible
(
visible
:
boolean
):
void
{
const
wasVisible
=
this
.
isVisible
();
super
.
setVisible
(
visible
);
if
(
this
.
isVisible
())
{
if
(
!
wasVisible
)
{
this
.
refreshPanel
();
}
}
else
{
this
.
rangeHighlightDecorations
.
removeHighlightRange
();
}
}
public
getActions
():
IAction
[]
{
public
getActions
():
IAction
[]
{
if
(
!
this
.
actions
)
{
if
(
!
this
.
actions
)
{
this
.
createActions
();
this
.
createActions
();
...
...
src/vs/workbench/parts/search/browser/searchView.ts
浏览文件 @
5eff1e2e
...
@@ -337,6 +337,32 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
...
@@ -337,6 +337,32 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
_register
(
this
.
onDidFocus
(()
=>
this
.
viewletFocused
.
set
(
true
)));
this
.
_register
(
this
.
onDidFocus
(()
=>
this
.
viewletFocused
.
set
(
true
)));
this
.
_register
(
this
.
onDidBlur
(()
=>
this
.
viewletFocused
.
set
(
false
)));
this
.
_register
(
this
.
onDidBlur
(()
=>
this
.
viewletFocused
.
set
(
false
)));
this
.
_register
(
this
.
onDidChangeVisibility
(
visible
=>
this
.
onVisibilityChanged
(
visible
)));
}
private
onVisibilityChanged
(
visible
:
boolean
):
void
{
this
.
viewletVisible
.
set
(
visible
);
if
(
visible
)
{
if
(
this
.
changedWhileHidden
)
{
// Render if results changed while viewlet was hidden - #37818
this
.
refreshAndUpdateCount
();
this
.
changedWhileHidden
=
false
;
}
}
// Enable highlights if there are searchresults
if
(
this
.
viewModel
)
{
this
.
viewModel
.
searchResult
.
toggleHighlights
(
visible
);
}
// Open focused element from results in case the editor area is otherwise empty
if
(
visible
&&
!
this
.
editorService
.
activeEditor
)
{
let
focus
=
this
.
tree
.
getFocus
();
if
(
focus
)
{
this
.
onFocus
(
focus
,
true
);
}
}
}
}
public
get
searchAndReplaceWidget
():
SearchWidget
{
public
get
searchAndReplaceWidget
():
SearchWidget
{
...
@@ -745,32 +771,6 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
...
@@ -745,32 +771,6 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
}
}
}
}
public
setVisible
(
visible
:
boolean
):
void
{
this
.
viewletVisible
.
set
(
visible
);
if
(
visible
)
{
if
(
this
.
changedWhileHidden
)
{
// Render if results changed while viewlet was hidden - #37818
this
.
refreshAndUpdateCount
();
this
.
changedWhileHidden
=
false
;
}
}
super
.
setVisible
(
visible
);
// Enable highlights if there are searchresults
if
(
this
.
viewModel
)
{
this
.
viewModel
.
searchResult
.
toggleHighlights
(
visible
);
}
// Open focused element from results in case the editor area is otherwise empty
if
(
visible
&&
!
this
.
editorService
.
activeEditor
)
{
let
focus
=
this
.
tree
.
getFocus
();
if
(
focus
)
{
this
.
onFocus
(
focus
,
true
);
}
}
}
public
moveFocusToResults
():
void
{
public
moveFocusToResults
():
void
{
this
.
tree
.
domFocus
();
this
.
tree
.
domFocus
();
}
}
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
5eff1e2e
...
@@ -96,24 +96,12 @@ export class TerminalPanel extends Panel {
...
@@ -96,24 +96,12 @@ export class TerminalPanel extends Panel {
this
.
_updateFont
();
this
.
_updateFont
();
this
.
_updateTheme
();
this
.
_updateTheme
();
// Force another layout (first is setContainers) since config has changed
this
.
_register
(
this
.
onDidChangeVisibility
(
visible
=>
{
this
.
layout
(
new
dom
.
Dimension
(
this
.
_terminalContainer
.
offsetWidth
,
this
.
_terminalContainer
.
offsetHeight
));
}
public
layout
(
dimension
?:
dom
.
Dimension
):
void
{
if
(
!
dimension
)
{
return
;
}
this
.
_terminalService
.
terminalTabs
.
forEach
(
t
=>
t
.
layout
(
dimension
.
width
,
dimension
.
height
));
}
public
setVisible
(
visible
:
boolean
):
void
{
if
(
visible
)
{
if
(
visible
)
{
if
(
this
.
_terminalService
.
terminalInstances
.
length
>
0
)
{
if
(
this
.
_terminalService
.
terminalInstances
.
length
>
0
)
{
this
.
_updateFont
();
this
.
_updateFont
();
this
.
_updateTheme
();
this
.
_updateTheme
();
}
else
{
}
else
{
super
.
setVisible
(
visible
);
// Check if instances were already restored as part of workbench restore
// Check if instances were already restored as part of workbench restore
if
(
this
.
_terminalService
.
terminalInstances
.
length
===
0
)
{
if
(
this
.
_terminalService
.
terminalInstances
.
length
===
0
)
{
this
.
_terminalService
.
createTerminal
();
this
.
_terminalService
.
createTerminal
();
...
@@ -122,11 +110,19 @@ export class TerminalPanel extends Panel {
...
@@ -122,11 +110,19 @@ export class TerminalPanel extends Panel {
this
.
_updateFont
();
this
.
_updateFont
();
this
.
_updateTheme
();
this
.
_updateTheme
();
}
}
return
;
}
}
}
}
super
.
setVisible
(
visible
);
}));
// Force another layout (first is setContainers) since config has changed
this
.
layout
(
new
dom
.
Dimension
(
this
.
_terminalContainer
.
offsetWidth
,
this
.
_terminalContainer
.
offsetHeight
));
}
public
layout
(
dimension
?:
dom
.
Dimension
):
void
{
if
(
!
dimension
)
{
return
;
}
this
.
_terminalService
.
terminalTabs
.
forEach
(
t
=>
t
.
layout
(
dimension
.
width
,
dimension
.
height
));
}
}
public
getActions
():
IAction
[]
{
public
getActions
():
IAction
[]
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录