Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
8f99fcd5
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,发现更多精彩内容 >>
提交
8f99fcd5
编写于
11月 27, 2017
作者:
C
Christof Marti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Surface editor part size in event to avoid having to recompute it (fixes #38556)
上级
952d76ee
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
17 deletion
+17
-17
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+4
-6
src/vs/workbench/parts/watermark/electron-browser/watermark.ts
...s/workbench/parts/watermark/electron-browser/watermark.ts
+4
-7
src/vs/workbench/services/part/common/partService.ts
src/vs/workbench/services/part/common/partService.ts
+6
-1
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+3
-3
未找到文件。
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
8f99fcd5
...
...
@@ -10,7 +10,7 @@ import 'vs/css!./media/workbench';
import
{
localize
}
from
'
vs/nls
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
Event
,
{
Emitter
,
chain
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
{
Delayer
,
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
...
...
@@ -37,7 +37,7 @@ import { IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbe
import
{
PanelRegistry
,
Extensions
as
PanelExtensions
}
from
'
vs/workbench/browser/panel
'
;
import
{
QuickOpenController
}
from
'
vs/workbench/browser/parts/quickopen/quickOpenController
'
;
import
{
getServices
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
Position
,
Parts
,
IPartService
,
ILayoutOptions
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
Position
,
Parts
,
IPartService
,
ILayoutOptions
,
Dimension
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
ContextMenuService
}
from
'
vs/workbench/services/contextview/electron-browser/contextmenuService
'
;
...
...
@@ -243,10 +243,8 @@ export class Workbench implements IPartService {
return
this
.
_onTitleBarVisibilityChange
.
event
;
}
public
get
onEditorLayout
():
Event
<
void
>
{
return
chain
(
this
.
editorPart
.
onLayout
)
.
map
(()
=>
void
0
)
.
event
;
public
get
onEditorLayout
():
Event
<
Dimension
>
{
return
this
.
editorPart
.
onLayout
;
}
/**
...
...
src/vs/workbench/parts/watermark/electron-browser/watermark.ts
浏览文件 @
8f99fcd5
...
...
@@ -21,7 +21,7 @@ import { OpenRecentAction } from 'vs/workbench/electron-browser/actions';
import
{
GlobalNewUntitledFileAction
}
from
'
vs/workbench/parts/files/electron-browser/fileActions
'
;
import
{
OpenFolderAction
,
OpenFileFolderAction
,
OpenFileAction
}
from
'
vs/workbench/browser/actions/workspaceActions
'
;
import
{
ShowAllCommandsAction
}
from
'
vs/workbench/parts/quickopen/browser/commandsHandler
'
;
import
{
Parts
,
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
Parts
,
IPartService
,
Dimension
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
StartAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
FindInFilesActionId
}
from
'
vs/workbench/parts/search/common/constants
'
;
import
{
ToggleTerminalAction
}
from
'
vs/workbench/parts/terminal/electron-browser/terminalActions
'
;
...
...
@@ -176,15 +176,12 @@ export class WatermarkContribution implements IWorkbenchContribution {
});
});
};
const
layout
=
()
=>
{
const
{
height
}
=
container
.
getBoundingClientRect
();
container
.
classList
[
height
<=
478
?
'
add
'
:
'
remove
'
](
'
max-height-478px
'
);
};
update
();
this
.
watermark
.
build
(
container
.
firstElementChild
as
HTMLElement
,
0
);
layout
();
this
.
toDispose
.
push
(
this
.
keybindingService
.
onDidUpdateKeybindings
(
update
));
this
.
toDispose
.
push
(
this
.
partService
.
onEditorLayout
(
layout
));
this
.
toDispose
.
push
(
this
.
partService
.
onEditorLayout
(({
height
}:
Dimension
)
=>
{
container
.
classList
[
height
<=
478
?
'
add
'
:
'
remove
'
](
'
max-height-478px
'
);
}));
}
private
destroy
():
void
{
...
...
src/vs/workbench/services/part/common/partService.ts
浏览文件 @
8f99fcd5
...
...
@@ -28,6 +28,11 @@ export interface ILayoutOptions {
source
?:
Parts
;
}
export
interface
Dimension
{
readonly
width
:
number
;
readonly
height
:
number
;
}
export
const
IPartService
=
createDecorator
<
IPartService
>
(
'
partService
'
);
export
interface
IPartService
{
...
...
@@ -41,7 +46,7 @@ export interface IPartService {
/**
* Emits when the editor part's layout changes.
*/
onEditorLayout
:
Event
<
void
>
;
onEditorLayout
:
Event
<
Dimension
>
;
/**
* Asks the part service to layout all parts.
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
8f99fcd5
...
...
@@ -20,7 +20,7 @@ import Severity from 'vs/base/common/severity';
import
{
IBackupFileService
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IPartService
,
Parts
,
Position
as
PartPosition
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IPartService
,
Parts
,
Position
as
PartPosition
,
Dimension
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
TextModelResolverService
}
from
'
vs/workbench/services/textmodelResolver/common/textModelResolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IEditorInput
,
IEditorOptions
,
Position
,
Direction
,
IEditor
,
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
...
...
@@ -342,13 +342,13 @@ export class TestPartService implements IPartService {
public
_serviceBrand
:
any
;
private
_onTitleBarVisibilityChange
=
new
Emitter
<
void
>
();
private
_onEditorLayout
=
new
Emitter
<
void
>
();
private
_onEditorLayout
=
new
Emitter
<
Dimension
>
();
public
get
onTitleBarVisibilityChange
():
Event
<
void
>
{
return
this
.
_onTitleBarVisibilityChange
.
event
;
}
public
get
onEditorLayout
():
Event
<
void
>
{
public
get
onEditorLayout
():
Event
<
Dimension
>
{
return
this
.
_onEditorLayout
.
event
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录