Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
dc120ded
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,发现更多精彩内容 >>
提交
dc120ded
编写于
2月 19, 2021
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tabs title -
💄
height compute
上级
f85b50f7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
42 addition
and
25 deletion
+42
-25
src/vs/workbench/browser/parts/editor/editor.ts
src/vs/workbench/browser/parts/editor/editor.ts
+3
-3
src/vs/workbench/browser/parts/editor/editorDropTarget.ts
src/vs/workbench/browser/parts/editor/editorDropTarget.ts
+1
-1
src/vs/workbench/browser/parts/editor/editorGroupView.ts
src/vs/workbench/browser/parts/editor/editorGroupView.ts
+3
-3
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
+4
-4
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+27
-10
src/vs/workbench/browser/parts/editor/titleControl.ts
src/vs/workbench/browser/parts/editor/titleControl.ts
+2
-2
src/vs/workbench/test/browser/workbenchTestServices.ts
src/vs/workbench/test/browser/workbenchTestServices.ts
+2
-2
未找到文件。
src/vs/workbench/browser/parts/editor/editor.ts
浏览文件 @
dc120ded
...
...
@@ -109,12 +109,12 @@ export interface IEditorGroupsAccessor {
arrangeGroups
(
arrangement
:
GroupsArrangement
,
target
?:
IEditorGroupView
|
GroupIdentifier
):
void
;
}
export
interface
IEditorGroupTitle
Dimensions
{
export
interface
IEditorGroupTitle
Height
{
/**
* The overall height of the editor group title control.
*/
height
:
number
;
total
:
number
;
/**
* The height offset to e.g. use when drawing drop overlays.
...
...
@@ -137,7 +137,7 @@ export interface IEditorGroupView extends IDisposable, ISerializableView, IEdito
readonly
group
:
EditorGroup
;
readonly
whenRestored
:
Promise
<
void
>
;
readonly
title
Dimensions
:
IEditorGroupTitleDimensions
;
readonly
title
Height
:
IEditorGroupTitleHeight
;
readonly
isEmpty
:
boolean
;
readonly
isMinimized
:
boolean
;
...
...
src/vs/workbench/browser/parts/editor/editorDropTarget.ts
浏览文件 @
dc120ded
...
...
@@ -521,7 +521,7 @@ class DropOverlay extends Themable {
// With tabs and opened editors: use the area below tabs as drop target
if
(
!
this
.
groupView
.
isEmpty
&&
this
.
accessor
.
partOptions
.
showTabs
)
{
return
this
.
groupView
.
title
Dimensions
.
offset
;
return
this
.
groupView
.
title
Height
.
offset
;
}
// Without tabs or empty group: use entire editor area as drop target
...
...
src/vs/workbench/browser/parts/editor/editorGroupView.ts
浏览文件 @
dc120ded
...
...
@@ -30,7 +30,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
Promises
,
RunOnceWorker
}
from
'
vs/base/common/async
'
;
import
{
EventType
as
TouchEventType
,
GestureEvent
}
from
'
vs/base/browser/touch
'
;
import
{
TitleControl
}
from
'
vs/workbench/browser/parts/editor/titleControl
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroupView
,
getActiveTextEditorOptions
,
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupTitle
Dimensions
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroupView
,
getActiveTextEditorOptions
,
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupTitle
Height
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
ActionRunner
,
IAction
,
Action
}
from
'
vs/base/common/actions
'
;
...
...
@@ -710,8 +710,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
return
this
.
_group
.
count
===
0
;
}
get
title
Dimensions
():
IEditorGroupTitleDimensions
{
return
this
.
titleAreaControl
.
get
Dimensions
();
get
title
Height
():
IEditorGroupTitleHeight
{
return
this
.
titleAreaControl
.
get
Height
();
}
get
isMinimized
():
boolean
{
...
...
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
浏览文件 @
dc120ded
...
...
@@ -14,7 +14,7 @@ import { IAction } from 'vs/base/common/actions';
import
{
CLOSE_EDITOR_COMMAND_ID
}
from
'
vs/workbench/browser/parts/editor/editorCommands
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
withNullAsUndefined
,
assertIsDefined
,
assertAllDefined
}
from
'
vs/base/common/types
'
;
import
{
IEditorGroupTitle
Dimensions
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorGroupTitle
Height
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
equals
}
from
'
vs/base/common/objects
'
;
interface
IRenderedEditorLabel
{
...
...
@@ -332,9 +332,9 @@ export class NoTabsTitleControl extends TitleControl {
return
{
primaryEditorActions
:
editorActions
.
primary
.
filter
(
action
=>
action
.
id
===
CLOSE_EDITOR_COMMAND_ID
),
secondaryEditorActions
:
[]
};
}
get
Dimensions
():
IEditorGroupTitleDimensions
{
get
Height
():
IEditorGroupTitleHeight
{
return
{
height
:
NoTabsTitleControl
.
HEIGHT
,
total
:
NoTabsTitleControl
.
HEIGHT
,
offset
:
0
};
}
...
...
@@ -344,6 +344,6 @@ export class NoTabsTitleControl extends TitleControl {
this
.
breadcrumbsControl
.
layout
(
undefined
);
}
return
new
Dimension
(
dimensions
.
container
.
width
,
this
.
get
Dimensions
().
height
);
return
new
Dimension
(
dimensions
.
container
.
width
,
this
.
get
Height
().
total
);
}
}
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
dc120ded
...
...
@@ -33,7 +33,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import
{
MergeGroupMode
,
IMergeGroupOptions
,
GroupsArrangement
,
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
addDisposableListener
,
EventType
,
EventHelper
,
Dimension
,
scheduleAtNextAnimationFrame
,
findParentWithClass
,
clearNode
}
from
'
vs/base/browser/dom
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroupView
,
EditorServiceImpl
,
IEditorGroupTitle
Dimensions
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroupView
,
EditorServiceImpl
,
IEditorGroupTitle
Height
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
CloseOneEditorAction
,
UnpinEditorAction
}
from
'
vs/workbench/browser/parts/editor/editorActions
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
BreadcrumbsControl
}
from
'
vs/workbench/browser/parts/editor/breadcrumbsControl
'
;
...
...
@@ -1290,25 +1290,42 @@ export class TabsTitleControl extends TitleControl {
tabContainer
.
style
.
outlineColor
=
this
.
getColor
(
activeContrastBorder
)
||
''
;
}
getDimensions
():
IEditorGroupTitleDimensions
{
let
height
:
number
;
getHeight
():
IEditorGroupTitleHeight
{
const
showsBreadcrumbs
=
this
.
breadcrumbsControl
&&
!
this
.
breadcrumbsControl
.
isHidden
();
// Return quickly if our used dimensions are known
if
(
this
.
dimensions
.
used
)
{
return
{
total
:
this
.
dimensions
.
used
.
height
,
offset
:
showsBreadcrumbs
?
this
.
dimensions
.
used
.
height
-
BreadcrumbsControl
.
HEIGHT
:
this
.
dimensions
.
used
.
height
};
}
// Otherwise compute via browser APIs
else
{
return
this
.
computeHeight
();
}
}
private
computeHeight
():
IEditorGroupTitleHeight
{
let
total
:
number
;
// Wrap: we need to ask `offsetHeight` to get
// the real height of the title area with wrapping.
if
(
this
.
accessor
.
partOptions
.
wrapTabs
&&
this
.
tabsAndActionsContainer
?.
classList
.
contains
(
'
wrapping
'
))
{
height
=
this
.
tabsAndActionsContainer
.
offsetHeight
;
total
=
this
.
tabsAndActionsContainer
.
offsetHeight
;
}
else
{
height
=
TabsTitleControl
.
TAB_HEIGHT
;
total
=
TabsTitleControl
.
TAB_HEIGHT
;
}
const
offset
=
height
;
const
offset
=
total
;
// Account for breadcrumbs if visible
if
(
this
.
breadcrumbsControl
&&
!
this
.
breadcrumbsControl
.
isHidden
())
{
height
+=
BreadcrumbsControl
.
HEIGHT
;
// Account for breadcrumbs if visible
total
+=
BreadcrumbsControl
.
HEIGHT
;
// Account for breadcrumbs if visible
}
return
{
height
,
offset
};
return
{
total
,
offset
};
}
layout
(
dimensions
:
ITitleControlDimensions
):
Dimension
{
...
...
@@ -1329,7 +1346,7 @@ export class TabsTitleControl extends TitleControl {
// First time layout: compute the dimensions and store it
if
(
!
this
.
dimensions
.
used
)
{
this
.
dimensions
.
used
=
new
Dimension
(
dimensions
.
container
.
width
,
this
.
getDimensions
().
height
);
this
.
dimensions
.
used
=
new
Dimension
(
dimensions
.
container
.
width
,
this
.
computeHeight
().
total
);
}
return
this
.
dimensions
.
used
;
...
...
@@ -1353,7 +1370,7 @@ export class TabsTitleControl extends TitleControl {
// return it fast from the `layout` call without having to
// compute it over and over again
const
oldDimension
=
this
.
dimensions
.
used
;
const
newDimension
=
this
.
dimensions
.
used
=
new
Dimension
(
dimensions
.
container
.
width
,
this
.
getDimensions
().
height
);
const
newDimension
=
this
.
dimensions
.
used
=
new
Dimension
(
dimensions
.
container
.
width
,
this
.
computeHeight
().
total
);
// In case the height of the title control changed from before
// (currently only possible if wrapping changed on/off), we need
...
...
src/vs/workbench/browser/parts/editor/titleControl.ts
浏览文件 @
dc120ded
...
...
@@ -30,7 +30,7 @@ import { DraggedEditorGroupIdentifier, DraggedEditorIdentifier, fillResourceData
import
{
EditorPane
}
from
'
vs/workbench/browser/parts/editor/editorPane
'
;
import
{
BreadcrumbsConfig
}
from
'
vs/workbench/browser/parts/editor/breadcrumbs
'
;
import
{
BreadcrumbsControl
,
IBreadcrumbsControlOptions
}
from
'
vs/workbench/browser/parts/editor/breadcrumbsControl
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroupTitle
Dimensions
,
IEditorGroupView
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroupTitle
Height
,
IEditorGroupView
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
EditorCommandsContextActionRunner
,
IEditorCommandsContext
,
IEditorInput
,
EditorResourceAccessor
,
IEditorPartOptions
,
SideBySideEditor
,
ActiveEditorPinnedContext
,
ActiveEditorStickyContext
}
from
'
vs/workbench/common/editor
'
;
import
{
ResourceContextKey
}
from
'
vs/workbench/common/resources
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
...
...
@@ -390,7 +390,7 @@ export abstract class TitleControl extends Themable {
abstract
layout
(
dimensions
:
ITitleControlDimensions
):
Dimension
;
abstract
get
Dimensions
():
IEditorGroupTitleDimensions
;
abstract
get
Height
():
IEditorGroupTitleHeight
;
dispose
():
void
{
dispose
(
this
.
breadcrumbsControl
);
...
...
src/vs/workbench/test/browser/workbenchTestServices.ts
浏览文件 @
dc120ded
...
...
@@ -10,7 +10,7 @@ import { URI } from 'vs/base/common/uri';
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
NullTelemetryService
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
IEditorInputWithOptions
,
IEditorIdentifier
,
IUntitledTextResourceEditorInput
,
IResourceDiffEditorInput
,
IEditorInput
,
IEditorPane
,
IEditorCloseEvent
,
IEditorPartOptions
,
IRevertOptions
,
GroupIdentifier
,
EditorInput
,
EditorOptions
,
EditorsOrder
,
IFileEditorInput
,
IEditorInputFactoryRegistry
,
IEditorInputFactory
,
Extensions
as
EditorExtensions
,
ISaveOptions
,
IMoveResult
,
ITextEditorPane
,
ITextDiffEditorPane
,
IVisibleEditorPane
,
IEditorOpenContext
,
SideBySideEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupView
,
IEditorGroupsAccessor
,
IEditorGroupTitle
Dimensions
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupView
,
IEditorGroupsAccessor
,
IEditorGroupTitle
Height
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IBackupFileService
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -650,7 +650,7 @@ export class TestEditorGroupView implements IEditorGroupView {
minimumHeight
!
:
number
;
maximumHeight
!
:
number
;
title
Dimensions
!
:
IEditorGroupTitleDimensions
;
title
Height
!
:
IEditorGroupTitleHeight
;
isEmpty
=
true
;
isMinimized
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录