Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a4fbe04f
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,发现更多精彩内容 >>
提交
a4fbe04f
编写于
2月 13, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
98f3ec82
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
70 addition
and
68 deletion
+70
-68
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+11
-10
src/vs/workbench/browser/parts/compositePart.ts
src/vs/workbench/browser/parts/compositePart.ts
+5
-5
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+7
-7
src/vs/workbench/browser/parts/panel/panelPart.ts
src/vs/workbench/browser/parts/panel/panelPart.ts
+14
-13
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
+14
-13
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
+8
-10
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
+11
-10
未找到文件。
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
a4fbe04f
...
...
@@ -6,7 +6,7 @@
import
'
vs/css!./media/activitybarpart
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
illegalArgument
}
from
'
vs/base/common/errors
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
E
vent
,
E
mitter
}
from
'
vs/base/common/event
'
;
import
{
ActionsOrientation
,
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
GlobalActivityExtensions
,
IGlobalActivityRegistry
}
from
'
vs/workbench/common/activity
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
...
...
@@ -50,6 +50,16 @@ export class ActivitybarPart extends Part implements ISerializableView {
private
static
readonly
ACTION_HEIGHT
=
50
;
private
static
readonly
PINNED_VIEWLETS
=
'
workbench.activity.pinnedViewlets
'
;
element
:
HTMLElement
;
readonly
minimumWidth
:
number
=
50
;
readonly
maximumWidth
:
number
=
50
;
readonly
minimumHeight
:
number
=
0
;
readonly
maximumHeight
:
number
=
Number
.
POSITIVE_INFINITY
;
private
_onDidChange
=
this
.
_register
(
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
());
get
onDidChange
():
Event
<
{
width
:
number
,
height
:
number
}
>
{
return
this
.
_onDidChange
.
event
;
}
private
dimension
:
Dimension
;
private
globalActionBar
:
ActionBar
;
...
...
@@ -59,15 +69,6 @@ export class ActivitybarPart extends Part implements ISerializableView {
private
compositeBar
:
CompositeBar
;
private
compositeActions
:
{
[
compositeId
:
string
]:
{
activityAction
:
ViewletActivityAction
,
pinnedAction
:
ToggleCompositePinnedAction
}
}
=
Object
.
create
(
null
);
element
:
HTMLElement
;
minimumWidth
:
number
=
50
;
maximumWidth
:
number
=
50
;
minimumHeight
:
number
=
0
;
maximumHeight
:
number
=
Number
.
POSITIVE_INFINITY
;
private
_onDidChange
=
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
();
readonly
onDidChange
=
this
.
_onDidChange
.
event
;
constructor
(
id
:
string
,
@
IViewletService
private
readonly
viewletService
:
IViewletService
,
...
...
src/vs/workbench/browser/parts/compositePart.ts
浏览文件 @
a4fbe04f
...
...
@@ -54,8 +54,8 @@ interface CompositeItem {
export
abstract
class
CompositePart
<
T
extends
Composite
>
extends
Part
{
protected
_
onDidCompositeOpen
=
this
.
_register
(
new
Emitter
<
{
composite
:
IComposite
,
focus
:
boolean
}
>
());
protected
_
onDidCompositeClose
=
this
.
_register
(
new
Emitter
<
IComposite
>
());
protected
readonly
onDidCompositeOpen
=
this
.
_register
(
new
Emitter
<
{
composite
:
IComposite
,
focus
:
boolean
}
>
());
protected
readonly
onDidCompositeClose
=
this
.
_register
(
new
Emitter
<
IComposite
>
());
protected
toolBar
:
ToolBar
;
...
...
@@ -140,7 +140,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
composite
.
focus
();
}
this
.
_
onDidCompositeOpen
.
fire
({
composite
,
focus
});
this
.
onDidCompositeOpen
.
fire
({
composite
,
focus
});
return
composite
;
}
...
...
@@ -152,7 +152,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
// Return with the composite that is being opened
if
(
composite
)
{
this
.
_
onDidCompositeOpen
.
fire
({
composite
,
focus
});
this
.
onDidCompositeOpen
.
fire
({
composite
,
focus
});
}
return
composite
;
...
...
@@ -375,7 +375,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
// Empty Actions
this
.
toolBar
.
setActions
([])();
this
.
_
onDidCompositeClose
.
fire
(
composite
);
this
.
onDidCompositeClose
.
fire
(
composite
);
return
composite
;
}
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
a4fbe04f
...
...
@@ -86,6 +86,13 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
private
static
readonly
EDITOR_PART_UI_STATE_STORAGE_KEY
=
'
editorpart.state
'
;
private
static
readonly
EDITOR_PART_CENTERED_VIEW_STORAGE_KEY
=
'
editorpart.centeredview
'
;
element
:
HTMLElement
;
private
_onDidChange
=
this
.
_register
(
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
());
get
onDidChange
():
Event
<
{
width
:
number
,
height
:
number
}
>
{
return
this
.
_onDidChange
.
event
;
}
readonly
priority
:
LayoutPriority
=
LayoutPriority
.
High
;
//#region Events
private
readonly
_onDidLayout
:
Emitter
<
Dimension
>
=
this
.
_register
(
new
Emitter
<
Dimension
>
());
...
...
@@ -135,13 +142,6 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
private
_whenRestored
:
Promise
<
void
>
;
private
whenRestoredResolve
:
()
=>
void
;
element
:
HTMLElement
;
private
_onDidChange
=
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
();
readonly
onDidChange
=
this
.
_onDidChange
.
event
;
priority
:
LayoutPriority
=
LayoutPriority
.
High
;
constructor
(
id
:
string
,
private
restorePreviousState
:
boolean
,
...
...
src/vs/workbench/browser/parts/panel/panelPart.ts
浏览文件 @
a4fbe04f
...
...
@@ -54,6 +54,18 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService, IS
_serviceBrand
:
any
;
element
:
HTMLElement
;
readonly
minimumWidth
:
number
=
300
;
readonly
maximumWidth
:
number
=
Number
.
POSITIVE_INFINITY
;
readonly
minimumHeight
:
number
=
77
;
readonly
maximumHeight
:
number
=
Number
.
POSITIVE_INFINITY
;
readonly
snapSize
:
number
=
50
;
readonly
priority
:
LayoutPriority
=
LayoutPriority
.
Low
;
private
_onDidChange
=
this
.
_register
(
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
());
get
onDidChange
():
Event
<
{
width
:
number
,
height
:
number
}
>
{
return
this
.
_onDidChange
.
event
;
}
private
activePanelContextKey
:
IContextKey
<
string
>
;
private
panelFocusContextKey
:
IContextKey
<
boolean
>
;
private
blockOpeningPanel
:
boolean
;
...
...
@@ -61,17 +73,6 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService, IS
private
compositeActions
:
{
[
compositeId
:
string
]:
{
activityAction
:
PanelActivityAction
,
pinnedAction
:
ToggleCompositePinnedAction
}
}
=
Object
.
create
(
null
);
private
dimension
:
Dimension
;
element
:
HTMLElement
;
minimumWidth
:
number
=
300
;
maximumWidth
:
number
=
Number
.
POSITIVE_INFINITY
;
minimumHeight
:
number
=
77
;
maximumHeight
:
number
=
Number
.
POSITIVE_INFINITY
;
snapSize
:
number
=
50
;
priority
:
LayoutPriority
=
LayoutPriority
.
Low
;
private
_onDidChange
=
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
();
readonly
onDidChange
=
this
.
_onDidChange
.
event
;
constructor
(
id
:
string
,
@
INotificationService
notificationService
:
INotificationService
,
...
...
@@ -194,11 +195,11 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService, IS
}
get
onDidPanelOpen
():
Event
<
{
panel
:
IPanel
,
focus
:
boolean
}
>
{
return
Event
.
map
(
this
.
_
onDidCompositeOpen
.
event
,
compositeOpen
=>
({
panel
:
compositeOpen
.
composite
,
focus
:
compositeOpen
.
focus
}));
return
Event
.
map
(
this
.
onDidCompositeOpen
.
event
,
compositeOpen
=>
({
panel
:
compositeOpen
.
composite
,
focus
:
compositeOpen
.
focus
}));
}
get
onDidPanelClose
():
Event
<
IPanel
>
{
return
this
.
_
onDidCompositeClose
.
event
;
return
this
.
onDidCompositeClose
.
event
;
}
updateStyles
():
void
{
...
...
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
浏览文件 @
a4fbe04f
...
...
@@ -41,23 +41,24 @@ export class SidebarPart extends CompositePart<Viewlet> implements ISerializable
static
readonly
activeViewletSettingsKey
=
'
workbench.sidebar.activeviewletid
'
;
element
:
HTMLElement
;
readonly
minimumWidth
:
number
=
170
;
readonly
maximumWidth
:
number
=
Number
.
POSITIVE_INFINITY
;
readonly
minimumHeight
:
number
=
0
;
readonly
maximumHeight
:
number
=
Number
.
POSITIVE_INFINITY
;
readonly
snapSize
:
number
=
50
;
readonly
priority
:
LayoutPriority
=
LayoutPriority
.
Low
;
private
_onDidChange
=
this
.
_register
(
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
());
get
onDidChange
():
Event
<
{
width
:
number
,
height
:
number
}
>
{
return
this
.
_onDidChange
.
event
;
}
private
viewletRegistry
:
ViewletRegistry
;
private
sideBarFocusContextKey
:
IContextKey
<
boolean
>
;
private
activeViewletContextKey
:
IContextKey
<
string
>
;
private
blockOpeningViewlet
:
boolean
;
private
_onDidViewletDeregister
=
this
.
_register
(
new
Emitter
<
ViewletDescriptor
>
());
element
:
HTMLElement
;
minimumWidth
:
number
=
170
;
maximumWidth
:
number
=
Number
.
POSITIVE_INFINITY
;
minimumHeight
:
number
=
0
;
maximumHeight
:
number
=
Number
.
POSITIVE_INFINITY
;
snapSize
:
number
=
50
;
priority
:
LayoutPriority
=
LayoutPriority
.
Low
;
private
_onDidChange
=
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
();
readonly
onDidChange
=
this
.
_onDidChange
.
event
;
constructor
(
id
:
string
,
@
INotificationService
notificationService
:
INotificationService
,
...
...
@@ -116,11 +117,11 @@ export class SidebarPart extends CompositePart<Viewlet> implements ISerializable
get
onDidViewletDeregister
():
Event
<
ViewletDescriptor
>
{
return
this
.
_onDidViewletDeregister
.
event
;
}
get
onDidViewletOpen
():
Event
<
IViewlet
>
{
return
Event
.
map
(
this
.
_
onDidCompositeOpen
.
event
,
compositeEvent
=>
<
IViewlet
>
compositeEvent
.
composite
);
return
Event
.
map
(
this
.
onDidCompositeOpen
.
event
,
compositeEvent
=>
<
IViewlet
>
compositeEvent
.
composite
);
}
get
onDidViewletClose
():
Event
<
IViewlet
>
{
return
this
.
_
onDidCompositeClose
.
event
as
Event
<
IViewlet
>
;
return
this
.
onDidCompositeClose
.
event
as
Event
<
IViewlet
>
;
}
create
(
parent
:
HTMLElement
):
void
{
...
...
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
浏览文件 @
a4fbe04f
...
...
@@ -27,11 +27,10 @@ import { Color } from 'vs/base/common/color';
import
{
addClass
,
EventHelper
,
createStyleSheet
,
addDisposableListener
,
Dimension
}
from
'
vs/base/browser/dom
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
E
vent
,
E
mitter
}
from
'
vs/base/common/event
'
;
import
{
ISerializableView
}
from
'
vs/base/browser/ui/grid/grid
'
;
import
{
Parts
}
from
'
vs/workbench/services/part/common/partService
'
;
export
class
StatusbarPart
extends
Part
implements
IStatusbarService
,
ISerializableView
{
_serviceBrand
:
any
;
...
...
@@ -39,17 +38,16 @@ export class StatusbarPart extends Part implements IStatusbarService, ISerializa
private
static
readonly
ALIGNMENT_PROP
=
'
statusbar-entry-alignment
'
;
element
:
HTMLElement
;
private
statusMsgDispose
:
IDisposable
;
readonly
minimumWidth
:
number
=
0
;
readonly
maximumWidth
:
number
=
Number
.
POSITIVE_INFINITY
;
readonly
minimumHeight
:
number
=
22
;
readonly
maximumHeight
:
number
=
22
;
minimumWidth
:
number
=
0
;
maximumWidth
:
number
=
Number
.
POSITIVE_INFINITY
;
minimumHeight
:
number
=
22
;
maximumHeight
:
number
=
22
;
private
_onDidChange
=
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
();
readonly
onDidChange
=
this
.
_onDidChange
.
event
;
private
_onDidChange
=
this
.
_register
(
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
());
get
onDidChange
():
Event
<
{
width
:
number
,
height
:
number
}
>
{
return
this
.
_onDidChange
.
event
;
}
private
statusMsgDispose
:
IDisposable
;
private
styleElement
:
HTMLStyleElement
;
constructor
(
...
...
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
浏览文件 @
a4fbe04f
...
...
@@ -38,8 +38,6 @@ import { Parts } from 'vs/workbench/services/part/common/partService';
export
class
TitlebarPart
extends
Part
implements
ITitleService
,
ISerializableView
{
_serviceBrand
:
any
;
private
static
readonly
NLS_UNSUPPORTED
=
nls
.
localize
(
'
patchedWindowTitle
'
,
"
[Unsupported]
"
);
private
static
readonly
NLS_USER_IS_ADMIN
=
isWindows
?
nls
.
localize
(
'
userIsAdmin
'
,
"
[Administrator]
"
)
:
nls
.
localize
(
'
userIsSudo
'
,
"
[Superuser]
"
);
private
static
readonly
NLS_EXTENSION_HOST
=
nls
.
localize
(
'
devExtensionWindowTitlePrefix
'
,
"
[Extension Development Host]
"
);
...
...
@@ -47,6 +45,17 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
private
static
readonly
TITLE_SEPARATOR
=
isMacintosh
?
'
—
'
:
'
-
'
;
// macOS uses special - separator
element
:
HTMLElement
;
readonly
minimumWidth
:
number
=
0
;
readonly
maximumWidth
:
number
=
Number
.
POSITIVE_INFINITY
;
get
minimumHeight
():
number
{
return
isMacintosh
?
22
/
getZoomFactor
()
:
(
30
/
(
this
.
configurationService
.
getValue
<
MenuBarVisibility
>
(
'
window.menuBarVisibility
'
)
===
'
hidden
'
?
getZoomFactor
()
:
1
));
}
get
maximumHeight
():
number
{
return
isMacintosh
?
22
/
getZoomFactor
()
:
(
30
/
(
this
.
configurationService
.
getValue
<
MenuBarVisibility
>
(
'
window.menuBarVisibility
'
)
===
'
hidden
'
?
getZoomFactor
()
:
1
));
}
private
_onDidChange
=
this
.
_register
(
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
());
get
onDidChange
():
Event
<
{
width
:
number
,
height
:
number
}
>
{
return
this
.
_onDidChange
.
event
;
}
_serviceBrand
:
any
;
private
title
:
HTMLElement
;
private
dragRegion
:
HTMLElement
;
private
windowControls
:
HTMLElement
;
...
...
@@ -64,14 +73,6 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
private
properties
:
ITitleProperties
;
private
activeEditorListeners
:
IDisposable
[];
minimumWidth
:
number
=
0
;
maximumWidth
:
number
=
Number
.
POSITIVE_INFINITY
;
get
minimumHeight
():
number
{
return
isMacintosh
?
22
/
getZoomFactor
()
:
(
30
/
(
this
.
configurationService
.
getValue
<
MenuBarVisibility
>
(
'
window.menuBarVisibility
'
)
===
'
hidden
'
?
getZoomFactor
()
:
1
));
}
get
maximumHeight
():
number
{
return
isMacintosh
?
22
/
getZoomFactor
()
:
(
30
/
(
this
.
configurationService
.
getValue
<
MenuBarVisibility
>
(
'
window.menuBarVisibility
'
)
===
'
hidden
'
?
getZoomFactor
()
:
1
));
}
private
_onDidChange
=
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
>
();
readonly
onDidChange
=
this
.
_onDidChange
.
event
;
constructor
(
id
:
string
,
@
IContextMenuService
private
readonly
contextMenuService
:
IContextMenuService
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录