Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
ecba7e96
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,发现更多精彩内容 >>
未验证
提交
ecba7e96
编写于
9月 23, 2021
作者:
S
SteVen Batten
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lift additional panel-specific items out of basepanelpart
上级
f092250f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
11 deletion
+46
-11
src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts
.../workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts
+22
-1
src/vs/workbench/browser/parts/panel/panelPart.ts
src/vs/workbench/browser/parts/panel/panelPart.ts
+24
-10
未找到文件。
src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.ts
浏览文件 @
ecba7e96
...
...
@@ -20,7 +20,10 @@ import { ActiveAuxiliaryContext, AuxiliaryBarFocusContext } from 'vs/workbench/c
import
{
SIDE_BAR_BACKGROUND
,
SIDE_BAR_TITLE_FOREGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
IViewDescriptorService
,
ViewContainerLocation
}
from
'
vs/workbench/common/views
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IWorkbenchLayoutService
,
Parts
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
IWorkbenchLayoutService
,
Parts
,
Position
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
import
{
Dimension
}
from
'
vs/base/browser/dom
'
;
import
{
IActivityHoverOptions
}
from
'
vs/workbench/browser/parts/compositeBarActions
'
;
import
{
HoverPosition
}
from
'
vs/base/browser/ui/hover/hoverWidget
'
;
export
class
AuxiliaryBarPart
extends
BasePanelPart
{
static
readonly
activePanelSettingsKey
=
'
workbench.auxiliarybar.activepanelid
'
;
...
...
@@ -70,6 +73,24 @@ export class AuxiliaryBarPart extends BasePanelPart {
);
}
protected
getActivityHoverOptions
():
IActivityHoverOptions
{
return
{
position
:
()
=>
HoverPosition
.
BELOW
};
}
override
layout
(
width
:
number
,
height
:
number
):
void
{
let
dimensions
:
Dimension
;
if
(
this
.
layoutService
.
getSideBarPosition
()
===
Position
.
LEFT
)
{
dimensions
=
new
Dimension
(
width
-
1
,
height
);
// Take into account the 1px border when layouting
}
else
{
dimensions
=
new
Dimension
(
width
,
height
);
}
// Layout contents
super
.
layout
(
dimensions
.
width
,
dimensions
.
height
);
}
override
toJSON
():
object
{
return
{
type
:
Parts
.
AUXILIARYBAR_PART
...
...
src/vs/workbench/browser/parts/panel/panelPart.ts
浏览文件 @
ecba7e96
...
...
@@ -22,7 +22,7 @@ import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/com
import
{
PANEL_BACKGROUND
,
PANEL_BORDER
,
PANEL_ACTIVE_TITLE_FOREGROUND
,
PANEL_INACTIVE_TITLE_FOREGROUND
,
PANEL_ACTIVE_TITLE_BORDER
,
PANEL_INPUT_BORDER
,
EDITOR_DRAG_AND_DROP_BACKGROUND
,
PANEL_DRAG_AND_DROP_BORDER
}
from
'
vs/workbench/common/theme
'
;
import
{
activeContrastBorder
,
focusBorder
,
contrastBorder
,
editorBackground
,
badgeBackground
,
badgeForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
CompositeBar
,
ICompositeBarItem
,
CompositeDragAndDrop
}
from
'
vs/workbench/browser/parts/compositeBar
'
;
import
{
ToggleCompositePinnedAction
}
from
'
vs/workbench/browser/parts/compositeBarActions
'
;
import
{
IActivityHoverOptions
,
ToggleCompositePinnedAction
}
from
'
vs/workbench/browser/parts/compositeBarActions
'
;
import
{
IBadge
}
from
'
vs/workbench/services/activity/common/activity
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
Dimension
,
trackFocus
,
EventHelper
,
$
}
from
'
vs/base/browser/dom
'
;
...
...
@@ -91,7 +91,7 @@ export abstract class BasePanelPart extends CompositePart<PaneComposite> impleme
private
readonly
panelDisposables
:
Map
<
string
,
IDisposable
>
=
new
Map
<
string
,
IDisposable
>
();
private
blockOpeningPanel
=
false
;
pr
ivate
contentDimension
:
Dimension
|
undefined
;
pr
otected
contentDimension
:
Dimension
|
undefined
;
private
extensionsRegistered
=
false
;
...
...
@@ -153,9 +153,7 @@ export abstract class BasePanelPart extends CompositePart<PaneComposite> impleme
this
.
compositeBar
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
CompositeBar
,
this
.
getCachedPanels
(),
{
icon
:
false
,
orientation
:
ActionsOrientation
.
HORIZONTAL
,
activityHoverOptions
:
{
position
:
()
=>
this
.
layoutService
.
getPanelPosition
()
===
Position
.
BOTTOM
&&
!
this
.
layoutService
.
isPanelMaximized
()
?
HoverPosition
.
ABOVE
:
HoverPosition
.
BELOW
,
},
activityHoverOptions
:
this
.
getActivityHoverOptions
(),
openComposite
:
(
compositeId
,
preserveFocus
)
=>
this
.
openPaneComposite
(
compositeId
,
!
preserveFocus
).
then
(
panel
=>
panel
||
null
),
getActivityAction
:
compositeId
=>
this
.
getCompositeActions
(
compositeId
).
activityAction
,
getCompositePinnedAction
:
compositeId
=>
this
.
getCompositeActions
(
compositeId
).
pinnedAction
,
...
...
@@ -192,6 +190,8 @@ export abstract class BasePanelPart extends CompositePart<PaneComposite> impleme
this
.
onDidRegisterPanels
([...
this
.
getPaneComposites
()]);
}
protected
abstract
getActivityHoverOptions
():
IActivityHoverOptions
;
private
getContextMenuActionsForComposite
(
compositeId
:
string
):
IAction
[]
{
const
result
:
IAction
[]
=
[];
const
viewContainer
=
this
.
viewDescriptorService
.
getViewContainerById
(
compositeId
)
!
;
...
...
@@ -597,11 +597,7 @@ export abstract class BasePanelPart extends CompositePart<PaneComposite> impleme
return
;
}
if
(
this
.
layoutService
.
getPanelPosition
()
===
Position
.
RIGHT
)
{
this
.
contentDimension
=
new
Dimension
(
width
-
1
,
height
);
// Take into account the 1px border when layouting
}
else
{
this
.
contentDimension
=
new
Dimension
(
width
,
height
);
}
this
.
contentDimension
=
new
Dimension
(
width
,
height
);
// Layout contents
super
.
layout
(
this
.
contentDimension
.
width
,
this
.
contentDimension
.
height
);
...
...
@@ -858,6 +854,12 @@ export class PanelPart extends BasePanelPart {
this
.
_register
(
this
.
globalActions
.
onDidChange
(()
=>
this
.
updateGlobalToolbarActions
()));
}
protected
getActivityHoverOptions
():
IActivityHoverOptions
{
return
{
position
:
()
=>
this
.
layoutService
.
getPanelPosition
()
===
Position
.
BOTTOM
&&
!
this
.
layoutService
.
isPanelMaximized
()
?
HoverPosition
.
ABOVE
:
HoverPosition
.
BELOW
,
};
}
override
createTitleArea
(
parent
:
HTMLElement
):
HTMLElement
{
const
element
=
super
.
createTitleArea
(
parent
);
const
globalTitleActionsContainer
=
element
.
appendChild
(
$
(
'
.global-actions
'
));
...
...
@@ -876,6 +878,18 @@ export class PanelPart extends BasePanelPart {
return
element
;
}
override
layout
(
width
:
number
,
height
:
number
):
void
{
let
dimensions
:
Dimension
;
if
(
this
.
layoutService
.
getPanelPosition
()
===
Position
.
RIGHT
)
{
dimensions
=
new
Dimension
(
width
-
1
,
height
);
// Take into account the 1px border when layouting
}
else
{
dimensions
=
new
Dimension
(
width
,
height
);
}
// Layout contents
super
.
layout
(
dimensions
.
width
,
dimensions
.
height
);
}
private
updateGlobalToolbarActions
():
void
{
const
primaryActions
=
this
.
globalActions
.
getPrimaryActions
();
const
secondaryActions
=
this
.
globalActions
.
getSecondaryActions
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录