Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8608aaeb
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,发现更多精彩内容 >>
提交
8608aaeb
编写于
12月 06, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve layout performance
fixes #39699
上级
5c927cf6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
17 deletion
+33
-17
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+3
-2
src/vs/workbench/browser/parts/panel/panelPart.ts
src/vs/workbench/browser/parts/panel/panelPart.ts
+12
-3
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+18
-12
未找到文件。
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
8608aaeb
...
...
@@ -39,6 +39,7 @@ export class ActivitybarPart extends Part {
badgeForeground
:
ACTIVITY_BAR_BADGE_FOREGROUND
,
dragAndDropBackground
:
ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND
};
private
static
readonly
ACTION_HEIGHT
=
50
;
public
_serviceBrand
:
any
;
...
...
@@ -72,7 +73,7 @@ export class ActivitybarPart extends Part {
getDefaultCompositeId
:
()
=>
this
.
viewletService
.
getDefaultViewletId
(),
hidePart
:
()
=>
this
.
partService
.
setSideBarHidden
(
true
),
colors
:
ActivitybarPart
.
COLORS
,
overflowActionSize
:
50
overflowActionSize
:
ActivitybarPart
.
ACTION_HEIGHT
});
this
.
registerListeners
();
}
...
...
@@ -196,7 +197,7 @@ export class ActivitybarPart extends Part {
let
availableHeight
=
this
.
dimension
.
height
;
if
(
this
.
globalActionBar
)
{
// adjust height for global actions showing
availableHeight
-=
(
this
.
globalActionBar
.
items
.
length
*
this
.
globalActionBar
.
domNode
.
clientHeight
);
availableHeight
-=
(
this
.
globalActionBar
.
items
.
length
*
ActivitybarPart
.
ACTION_HEIGHT
);
}
this
.
compositeBar
.
layout
(
new
Dimension
(
dimension
.
width
,
availableHeight
));
...
...
src/vs/workbench/browser/parts/panel/panelPart.ts
浏览文件 @
8608aaeb
...
...
@@ -43,6 +43,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
private
blockOpeningPanel
:
boolean
;
private
compositeBar
:
CompositeBar
;
private
dimension
:
Dimension
;
private
toolbarWidth
=
new
Map
<
string
,
number
>
();
constructor
(
id
:
string
,
...
...
@@ -234,14 +235,22 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
let
availableWidth
=
this
.
dimension
.
width
-
40
;
// take padding into account
if
(
this
.
toolBar
)
{
// adjust height for global actions showing
availableWidth
=
Math
.
max
(
PanelPart
.
MIN_COMPOSITE_BAR_WIDTH
,
availableWidth
-
this
.
toolbarWidth
);
availableWidth
=
Math
.
max
(
PanelPart
.
MIN_COMPOSITE_BAR_WIDTH
,
availableWidth
-
this
.
getToolbarWidth
()
);
}
this
.
compositeBar
.
layout
(
new
Dimension
(
availableWidth
,
this
.
dimension
.
height
));
}
}
private
get
toolbarWidth
():
number
{
return
this
.
toolBar
.
getContainer
().
getHTMLElement
().
offsetWidth
;
private
getToolbarWidth
():
number
{
const
activePanel
=
this
.
getActivePanel
();
if
(
!
activePanel
)
{
return
0
;
}
if
(
!
this
.
toolbarWidth
.
has
(
activePanel
.
getId
()))
{
this
.
toolbarWidth
.
set
(
activePanel
.
getId
(),
this
.
toolBar
.
getContainer
().
getHTMLElement
().
offsetWidth
);
}
return
this
.
toolbarWidth
.
get
(
activePanel
.
getId
());
}
public
shutdown
():
void
{
...
...
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
8608aaeb
...
...
@@ -42,6 +42,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import
{
clipboard
}
from
'
electron
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
WorkbenchTree
,
IListService
}
from
'
vs/platform/list/browser/listService
'
;
import
{
memoize
}
from
'
vs/base/common/decorators
'
;
const
$
=
dom
.
$
;
...
...
@@ -73,7 +74,7 @@ export class Repl extends Panel implements IPrivateReplService {
private
tree
:
ITree
;
private
renderer
:
ReplExpressionsRenderer
;
private
c
haracterWidthSurveyo
r
:
HTMLElement
;
private
c
ontaine
r
:
HTMLElement
;
private
treeContainer
:
HTMLElement
;
private
replInput
:
ReplInputEditor
;
private
replInputContainer
:
HTMLElement
;
...
...
@@ -128,16 +129,9 @@ export class Repl extends Panel implements IPrivateReplService {
public
create
(
parent
:
Builder
):
TPromise
<
void
>
{
super
.
create
(
parent
);
const
container
=
dom
.
append
(
parent
.
getHTMLElement
(),
$
(
'
.repl
'
));
this
.
treeContainer
=
dom
.
append
(
container
,
$
(
'
.repl-tree
'
));
this
.
createReplInput
(
container
);
this
.
characterWidthSurveyor
=
dom
.
append
(
container
,
$
(
'
.surveyor
'
));
this
.
characterWidthSurveyor
.
textContent
=
Repl
.
HALF_WIDTH_TYPICAL
;
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
this
.
characterWidthSurveyor
.
textContent
+=
this
.
characterWidthSurveyor
.
textContent
;
}
this
.
characterWidthSurveyor
.
style
.
fontSize
=
isMacintosh
?
'
12px
'
:
'
14px
'
;
this
.
container
=
dom
.
append
(
parent
.
getHTMLElement
(),
$
(
'
.repl
'
));
this
.
treeContainer
=
dom
.
append
(
this
.
container
,
$
(
'
.repl-tree
'
));
this
.
createReplInput
(
this
.
container
);
this
.
renderer
=
this
.
instantiationService
.
createInstance
(
ReplExpressionsRenderer
);
const
controller
=
this
.
instantiationService
.
createInstance
(
ReplExpressionsController
,
new
ReplExpressionsActionProvider
(
this
.
instantiationService
),
MenuId
.
DebugConsoleContext
);
...
...
@@ -242,7 +236,7 @@ export class Repl extends Panel implements IPrivateReplService {
public
layout
(
dimension
:
Dimension
):
void
{
this
.
dimension
=
dimension
;
if
(
this
.
tree
)
{
this
.
renderer
.
setWidth
(
dimension
.
width
-
25
,
this
.
characterWidth
Surveyor
.
clientWidth
/
this
.
characterWidthSurveyor
.
textContent
.
length
);
this
.
renderer
.
setWidth
(
dimension
.
width
-
25
,
this
.
characterWidth
);
const
treeHeight
=
dimension
.
height
-
this
.
replInputHeight
;
this
.
treeContainer
.
style
.
height
=
`
${
treeHeight
}
px`
;
this
.
tree
.
layout
(
treeHeight
);
...
...
@@ -252,6 +246,18 @@ export class Repl extends Panel implements IPrivateReplService {
this
.
replInput
.
layout
({
width
:
dimension
.
width
-
20
,
height
:
this
.
replInputHeight
});
}
@
memoize
private
get
characterWidth
():
number
{
const
characterWidthSurveyor
=
dom
.
append
(
this
.
container
,
$
(
'
.surveyor
'
));
characterWidthSurveyor
.
textContent
=
Repl
.
HALF_WIDTH_TYPICAL
;
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
characterWidthSurveyor
.
textContent
+=
characterWidthSurveyor
.
textContent
;
}
characterWidthSurveyor
.
style
.
fontSize
=
isMacintosh
?
'
12px
'
:
'
14px
'
;
return
characterWidthSurveyor
.
clientWidth
/
characterWidthSurveyor
.
textContent
.
length
;
}
public
focus
():
void
{
this
.
replInput
.
focus
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录