Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d231a506
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,体验更适合开发者的 AI 搜索 >>
提交
d231a506
编写于
1月 15, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
panel: renames based on Ben's feedback
上级
867f165c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
44 addition
and
44 deletion
+44
-44
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+25
-25
src/vs/workbench/browser/parts/compositePart.ts
src/vs/workbench/browser/parts/compositePart.ts
+2
-2
src/vs/workbench/browser/parts/panel/panelPart.ts
src/vs/workbench/browser/parts/panel/panelPart.ts
+2
-2
src/vs/workbench/browser/workbench.ts
src/vs/workbench/browser/workbench.ts
+10
-10
src/vs/workbench/common/constants.ts
src/vs/workbench/common/constants.ts
+1
-1
src/vs/workbench/services/part/common/partService.ts
src/vs/workbench/services/part/common/partService.ts
+2
-2
src/vs/workbench/test/browser/servicesTestUtils.ts
src/vs/workbench/test/browser/servicesTestUtils.ts
+2
-2
未找到文件。
src/vs/workbench/browser/layout.ts
浏览文件 @
d231a506
...
...
@@ -44,7 +44,7 @@ export class LayoutOptions {
interface
ComputedStyles
{
activitybar
:
{
minWidth
:
number
;
};
sidebar
:
{
minWidth
:
number
;
};
panel
Part
:
{
minHeight
:
number
;
}
panel
:
{
minHeight
:
number
;
}
editor
:
{
minWidth
:
number
;
};
statusbar
:
{
height
:
number
;
};
}
...
...
@@ -55,7 +55,7 @@ interface ComputedStyles {
export
class
WorkbenchLayout
implements
IVerticalSashLayoutProvider
,
IHorizontalSashLayoutProvider
{
private
static
sashXWidthSettingsKey
=
'
workbench.sidebar.width
'
;
private
static
sashYHeightSettingsKey
=
'
workbench.panel
part
.height
'
;
private
static
sashYHeightSettingsKey
=
'
workbench.panel.height
'
;
private
parent
:
Builder
;
private
workbenchContainer
:
Builder
;
...
...
@@ -74,9 +74,9 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
private
startSidebarWidth
:
number
;
private
sidebarWidth
:
number
;
private
sidebarHeight
:
number
;
private
startPanel
Part
Height
:
number
;
private
panel
Part
Height
:
number
;
private
panel
Part
Width
:
number
;
private
startPanelHeight
:
number
;
private
panelHeight
:
number
;
private
panelWidth
:
number
;
// Take parts as an object bag since instatation service does not have typings for constructors with 9+ arguments
constructor
(
...
...
@@ -118,7 +118,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
});
this
.
sidebarWidth
=
this
.
storageService
.
getInteger
(
WorkbenchLayout
.
sashXWidthSettingsKey
,
StorageScope
.
GLOBAL
,
-
1
);
this
.
panel
Part
Height
=
this
.
storageService
.
getInteger
(
WorkbenchLayout
.
sashYHeightSettingsKey
,
StorageScope
.
GLOBAL
,
0
);
this
.
panelHeight
=
this
.
storageService
.
getInteger
(
WorkbenchLayout
.
sashYHeightSettingsKey
,
StorageScope
.
GLOBAL
,
0
);
this
.
registerListeners
();
this
.
registerSashListeners
();
...
...
@@ -139,7 +139,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
});
this
.
sashY
.
addListener
(
'
start
'
,
(
e
:
ISashEvent
)
=>
{
this
.
startPanel
PartHeight
=
this
.
panelPart
Height
;
this
.
startPanel
Height
=
this
.
panel
Height
;
startY
=
e
.
startY
;
});
...
...
@@ -184,15 +184,15 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this
.
sashY
.
addListener
(
'
change
'
,
(
e
:
ISashEvent
)
=>
{
let
doLayout
=
false
;
let
isPanel
PartHidden
=
this
.
partService
.
isPanelPart
Hidden
();
let
newSashHeight
=
this
.
startPanel
Part
Height
-
(
e
.
currentY
-
startY
);
let
isPanel
Hidden
=
this
.
partService
.
isPanel
Hidden
();
let
newSashHeight
=
this
.
startPanelHeight
-
(
e
.
currentY
-
startY
);
// Panel visible
if
(
!
isPanel
Part
Hidden
)
{
if
(
!
isPanelHidden
)
{
// TODO@Isidor Automatically hide panel when a certain threshold is met
this
.
panel
PartHeight
=
Math
.
max
(
this
.
computedStyles
.
panelPart
.
minHeight
,
newSashHeight
);
// Panel can not become smaller than MIN_PART_HEIGHT
doLayout
=
newSashHeight
>=
this
.
computedStyles
.
panel
Part
.
minHeight
;
this
.
panel
Height
=
Math
.
max
(
this
.
computedStyles
.
panel
.
minHeight
,
newSashHeight
);
// Panel can not become smaller than MIN_PART_HEIGHT
doLayout
=
newSashHeight
>=
this
.
computedStyles
.
panel
.
minHeight
;
}
if
(
doLayout
)
{
this
.
layout
();
...
...
@@ -203,7 +203,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this
.
storageService
.
store
(
WorkbenchLayout
.
sashXWidthSettingsKey
,
this
.
sidebarWidth
,
StorageScope
.
GLOBAL
);
});
this
.
sashY
.
addListener
(
'
end
'
,
()
=>
{
this
.
storageService
.
store
(
WorkbenchLayout
.
sashYHeightSettingsKey
,
this
.
panel
Part
Height
,
StorageScope
.
GLOBAL
);
this
.
storageService
.
store
(
WorkbenchLayout
.
sashYHeightSettingsKey
,
this
.
panelHeight
,
StorageScope
.
GLOBAL
);
});
}
...
...
@@ -249,7 +249,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
minWidth
:
parseInt
(
sidebarStyle
.
getPropertyValue
(
'
min-width
'
),
10
)
||
DEFAULT_MIN_PART_WIDTH
},
panel
Part
:
{
panel
:
{
minHeight
:
parseInt
(
panelPartStyle
.
getPropertyValue
(
'
min-height
'
),
10
)
||
DEFAULT_MIN_PANEL_PART_HEIGHT
},
...
...
@@ -283,7 +283,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this
.
workbenchSize
=
this
.
getWorkbenchArea
();
const
isSidebarHidden
=
this
.
partService
.
isSideBarHidden
();
const
isPanel
PartHidden
=
this
.
partService
.
isPanelPart
Hidden
();
const
isPanel
Hidden
=
this
.
partService
.
isPanel
Hidden
();
const
sidebarPosition
=
this
.
partService
.
getSideBarPosition
();
// Sidebar
...
...
@@ -306,15 +306,15 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
// Panel part
let
panelHeight
:
number
;
if
(
isPanel
Part
Hidden
)
{
if
(
isPanelHidden
)
{
panelHeight
=
0
;
}
else
if
(
this
.
panel
Part
Height
>
0
)
{
panelHeight
=
Math
.
min
(
sidebarSize
.
height
*
PANEL_HEIGHT_SCREEN_LIMIT
,
Math
.
max
(
this
.
computedStyles
.
panel
Part
.
minHeight
,
this
.
panelPart
Height
));
}
else
if
(
this
.
panelHeight
>
0
)
{
panelHeight
=
Math
.
min
(
sidebarSize
.
height
*
PANEL_HEIGHT_SCREEN_LIMIT
,
Math
.
max
(
this
.
computedStyles
.
panel
.
minHeight
,
this
.
panel
Height
));
}
else
{
panelHeight
=
sidebarSize
.
height
*
0.4
;
}
const
panelDimension
=
new
Dimension
(
this
.
workbenchSize
.
width
-
sidebarSize
.
width
-
activityBarSize
.
width
,
panelHeight
);
this
.
panel
Part
Width
=
panelDimension
.
width
;
this
.
panelWidth
=
panelDimension
.
width
;
// Editor
let
editorSize
=
{
...
...
@@ -359,9 +359,9 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this
.
storageService
.
store
(
WorkbenchLayout
.
sashXWidthSettingsKey
,
this
.
sidebarWidth
,
StorageScope
.
GLOBAL
);
}
if
(
!
isPanel
Part
Hidden
)
{
this
.
panel
Part
Height
=
panelDimension
.
height
;
this
.
storageService
.
store
(
WorkbenchLayout
.
sashYHeightSettingsKey
,
this
.
panel
Part
Height
,
StorageScope
.
GLOBAL
);
if
(
!
isPanelHidden
)
{
this
.
panelHeight
=
panelDimension
.
height
;
this
.
storageService
.
store
(
WorkbenchLayout
.
sashYHeightSettingsKey
,
this
.
panelHeight
,
StorageScope
.
GLOBAL
);
}
// Workbench
...
...
@@ -419,7 +419,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
// Sashes
this
.
sashX
.
layout
();
isPanel
Part
Hidden
?
this
.
sashY
.
hide
()
:
this
.
sashY
.
show
();
isPanelHidden
?
this
.
sashY
.
hide
()
:
this
.
sashY
.
show
();
this
.
sashY
.
layout
();
// Propagate to Part Layouts
...
...
@@ -463,7 +463,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
}
public
getHorizontalSashTop
(
sash
:
Sash
):
number
{
return
this
.
sidebarHeight
-
this
.
panel
Part
Height
;
return
this
.
sidebarHeight
-
this
.
panelHeight
;
}
public
getHorizontalSashLeft
(
sash
:
Sash
):
number
{
...
...
@@ -471,7 +471,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
}
public
getHorizontalSashWidth
(
sash
:
Sash
):
number
{
return
this
.
panel
Part
Width
;
return
this
.
panelWidth
;
}
public
dispose
():
void
{
...
...
src/vs/workbench/browser/parts/compositePart.ts
浏览文件 @
d231a506
...
...
@@ -174,7 +174,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
// Fill Content and Actions
return
createCompositePromise
.
then
(()
=>
{
// Make sure that the user meanwhile did not open another composite or closed the
sidebar
// Make sure that the user meanwhile did not open another composite or closed the
part containing the composite
if
(
!
this
.
activeComposite
||
composite
.
getId
()
!==
this
.
activeComposite
.
getId
())
{
return
;
}
...
...
@@ -222,7 +222,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
// Indicate to composite that it is now visible
return
composite
.
setVisible
(
true
).
then
(()
=>
{
// Make sure that the user meanwhile did not open another composite or closed the
sidebar
// Make sure that the user meanwhile did not open another composite or closed the
part containing the composite
if
(
!
this
.
activeComposite
||
composite
.
getId
()
!==
this
.
activeComposite
.
getId
())
{
return
;
}
...
...
src/vs/workbench/browser/parts/panel/panelPart.ts
浏览文件 @
d231a506
...
...
@@ -50,10 +50,10 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
}
// First check if panel part is hidden and show if so
if
(
this
.
partService
.
isPanel
Part
Hidden
())
{
if
(
this
.
partService
.
isPanelHidden
())
{
try
{
this
.
blockOpeningPanel
=
true
;
this
.
partService
.
setPanel
Part
Hidden
(
false
);
this
.
partService
.
setPanelHidden
(
false
);
}
finally
{
this
.
blockOpeningPanel
=
false
;
}
...
...
src/vs/workbench/browser/workbench.ts
浏览文件 @
d231a506
...
...
@@ -82,7 +82,7 @@ export class Workbench implements IPartService {
private
static
sidebarPositionSettingKey
=
'
workbench.sidebar.position
'
;
private
static
sidebarHiddenSettingKey
=
'
workbench.sidebar.hidden
'
;
private
static
panel
PartHiddenSettingKey
=
'
workbench.panelPart
.hidden
'
;
private
static
panel
HiddenSettingKey
=
'
workbench.panel
.hidden
'
;
public
serviceId
=
IPartService
;
...
...
@@ -117,7 +117,7 @@ export class Workbench implements IPartService {
private
creationPromiseComplete
:
ValueCallback
;
private
sideBarHidden
:
boolean
;
private
sideBarPosition
:
Position
;
private
panel
Part
Hidden
:
boolean
;
private
panelHidden
:
boolean
;
private
editorBackgroundDelayer
:
Delayer
<
void
>
;
constructor
(
container
:
HTMLElement
,
workspace
:
IWorkspace
,
configuration
:
IConfiguration
,
options
:
IOptions
,
instantiationService
:
IInstantiationService
)
{
...
...
@@ -419,9 +419,9 @@ export class Workbench implements IPartService {
}
// Panel part visibility
this
.
panel
PartHidden
=
this
.
storageService
.
getBoolean
(
Workbench
.
panelPart
HiddenSettingKey
,
StorageScope
.
WORKSPACE
,
true
);
this
.
panel
Hidden
=
this
.
storageService
.
getBoolean
(
Workbench
.
panel
HiddenSettingKey
,
StorageScope
.
WORKSPACE
,
true
);
if
(
!!
this
.
workbenchParams
.
options
.
singleFileMode
)
{
this
.
panel
Part
Hidden
=
true
;
// we hide panel part in single-file-mode
this
.
panelHidden
=
true
;
// we hide panel part in single-file-mode
}
// Sidebar position
...
...
@@ -484,7 +484,7 @@ export class Workbench implements IPartService {
return
!
this
.
sideBarHidden
;
}
if
(
part
===
Parts
.
PANEL_PART
)
{
return
!
this
.
panel
Part
Hidden
;
return
!
this
.
panelHidden
;
}
return
true
;
// any other part cannot be hidden
...
...
@@ -533,12 +533,12 @@ export class Workbench implements IPartService {
this
.
storageService
.
store
(
Workbench
.
sidebarHiddenSettingKey
,
hidden
?
'
true
'
:
'
false
'
,
StorageScope
.
WORKSPACE
);
}
public
isPanel
Part
Hidden
():
boolean
{
return
this
.
panel
Part
Hidden
;
public
isPanelHidden
():
boolean
{
return
this
.
panelHidden
;
}
public
setPanel
Part
Hidden
(
hidden
:
boolean
,
skipLayout
?:
boolean
):
void
{
this
.
panel
Part
Hidden
=
hidden
;
public
setPanelHidden
(
hidden
:
boolean
,
skipLayout
?:
boolean
):
void
{
this
.
panelHidden
=
hidden
;
// Layout
if
(
!
skipLayout
)
{
...
...
@@ -566,7 +566,7 @@ export class Workbench implements IPartService {
}
// Remember in settings
this
.
storageService
.
store
(
Workbench
.
panel
Part
HiddenSettingKey
,
hidden
?
'
true
'
:
'
false
'
,
StorageScope
.
WORKSPACE
);
this
.
storageService
.
store
(
Workbench
.
panelHiddenSettingKey
,
hidden
?
'
true
'
:
'
false
'
,
StorageScope
.
WORKSPACE
);
}
public
getSideBarPosition
():
Position
{
...
...
src/vs/workbench/common/constants.ts
浏览文件 @
d231a506
...
...
@@ -16,7 +16,7 @@ export const Identifiers = {
WORKBENCH_CONTAINER
:
'
workbench.main.container
'
,
ACTIVITYBAR_PART
:
'
workbench.parts.activitybar
'
,
SIDEBAR_PART
:
'
workbench.parts.sidebar
'
,
PANEL_PART
:
'
workbench.parts.panel
part
'
,
PANEL_PART
:
'
workbench.parts.panel
'
,
EDITOR_PART
:
'
workbench.parts.editor
'
,
STATUSBAR_PART
:
'
workbench.parts.statusbar
'
};
...
...
src/vs/workbench/services/part/common/partService.ts
浏览文件 @
d231a506
...
...
@@ -63,12 +63,12 @@ export interface IPartService {
/**
* Checks if the panel part is currently hidden or not
*/
isPanel
Part
Hidden
():
boolean
;
isPanelHidden
():
boolean
;
/**
* Set panel part hidden or not
*/
setPanel
Part
Hidden
(
hidden
:
boolean
):
void
;
setPanelHidden
(
hidden
:
boolean
):
void
;
/**
* Gets the current side bar position. Note that the sidebar can be hidden too.
...
...
src/vs/workbench/test/browser/servicesTestUtils.ts
浏览文件 @
d231a506
...
...
@@ -212,11 +212,11 @@ export class TestPartService implements PartService.IPartService {
public
setSideBarHidden
(
hidden
:
boolean
):
void
{
}
public
isPanel
Part
Hidden
():
boolean
{
public
isPanelHidden
():
boolean
{
return
false
;
}
public
setPanel
Part
Hidden
(
hidden
:
boolean
):
void
{
}
public
setPanelHidden
(
hidden
:
boolean
):
void
{
}
public
getSideBarPosition
()
{
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录