Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7d1ccd3e
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,发现更多精彩内容 >>
提交
7d1ccd3e
编写于
9月 22, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
editors - restore offset for drop ops as it was
上级
4ad16553
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
39 addition
and
15 deletion
+39
-15
src/vs/workbench/browser/parts/editor/editor.ts
src/vs/workbench/browser/parts/editor/editor.ts
+17
-1
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
+4
-4
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
+6
-2
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+6
-3
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
+3
-2
未找到文件。
src/vs/workbench/browser/parts/editor/editor.ts
浏览文件 @
7d1ccd3e
...
...
@@ -108,6 +108,22 @@ export interface IEditorGroupsAccessor {
arrangeGroups
(
arrangement
:
GroupsArrangement
,
target
?:
IEditorGroupView
|
GroupIdentifier
):
void
;
}
export
interface
IEditorGroupTitleDimensions
{
/**
* The overall height of the editor group title control.
*/
height
:
number
;
/**
* The height offset to e.g. use when drawing drop overlays.
* This number may be smaller than `height` if the title control
* decides to have an `offset` that is within the title area
* (e.g. when breadcrumbs are enabled).
*/
offset
:
number
;
}
export
interface
IEditorGroupView
extends
IDisposable
,
ISerializableView
,
IEditorGroup
{
readonly
onDidFocus
:
Event
<
void
>
;
...
...
@@ -120,7 +136,7 @@ export interface IEditorGroupView extends IDisposable, ISerializableView, IEdito
readonly
group
:
EditorGroup
;
readonly
whenRestored
:
Promise
<
void
>
;
readonly
preferredTitleHeight
:
number
;
readonly
titleDimensions
:
IEditorGroupTitleDimensions
;
readonly
isEmpty
:
boolean
;
readonly
isMinimized
:
boolean
;
...
...
src/vs/workbench/browser/parts/editor/editorDropTarget.ts
浏览文件 @
7d1ccd3e
...
...
@@ -503,7 +503,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
.
preferredTitleHeigh
t
;
return
this
.
groupView
.
titleDimensions
.
offse
t
;
}
// Without tabs or empty group: use entire editor area as drop target
...
...
src/vs/workbench/browser/parts/editor/editorGroupView.ts
浏览文件 @
7d1ccd3e
...
...
@@ -30,7 +30,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
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
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroupView
,
getActiveTextEditorOptions
,
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupTitleDimensions
}
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
'
;
...
...
@@ -717,8 +717,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
return
this
.
_group
.
count
===
0
;
}
get
preferredTitleHeight
():
number
{
return
this
.
titleAreaControl
.
get
PreferredHeight
();
get
titleDimensions
():
IEditorGroupTitleDimensions
{
return
this
.
titleAreaControl
.
get
Dimensions
();
}
get
isMinimized
():
boolean
{
...
...
@@ -1699,7 +1699,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
this
.
dimension
=
new
Dimension
(
width
,
height
);
// Ensure editor container gets height as CSS depending on the preferred height of the title control
const
titleHeight
=
this
.
preferredTitleH
eight
;
const
titleHeight
=
this
.
titleDimensions
.
h
eight
;
const
editorHeight
=
Math
.
max
(
0
,
height
-
titleHeight
);
this
.
editorContainer
.
style
.
height
=
`
${
editorHeight
}
px`
;
...
...
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
浏览文件 @
7d1ccd3e
...
...
@@ -14,6 +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
{
IEditorGroupTitleDimensions
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
interface
IRenderedEditorLabel
{
editor
?:
IEditorInput
;
...
...
@@ -315,8 +316,11 @@ export class NoTabsTitleControl extends TitleControl {
return
{
primaryEditorActions
:
editorActions
.
primary
.
filter
(
action
=>
action
.
id
===
CLOSE_EDITOR_COMMAND_ID
),
secondaryEditorActions
:
[]
};
}
getPreferredHeight
():
number
{
return
NoTabsTitleControl
.
HEIGHT
;
getDimensions
():
IEditorGroupTitleDimensions
{
return
{
height
:
NoTabsTitleControl
.
HEIGHT
,
offset
:
0
};
}
layout
(
dimension
:
Dimension
):
void
{
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
7d1ccd3e
...
...
@@ -34,7 +34,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
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
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroupView
,
EditorServiceImpl
,
IEditorGroupTitleDimensions
}
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
'
;
...
...
@@ -1222,13 +1222,16 @@ export class TabsTitleControl extends TitleControl {
return
hasModifiedBorderColor
;
}
get
PreferredHeight
():
number
{
get
Dimensions
():
IEditorGroupTitleDimensions
{
let
height
=
TabsTitleControl
.
TAB_HEIGHT
;
if
(
this
.
breadcrumbsControl
&&
!
this
.
breadcrumbsControl
.
isHidden
())
{
height
+=
BreadcrumbsControl
.
HEIGHT
;
}
return
height
;
return
{
height
,
offset
:
TabsTitleControl
.
TAB_HEIGHT
};
}
layout
(
dimension
:
Dimension
|
undefined
):
void
{
...
...
src/vs/workbench/browser/parts/editor/titleControl.ts
浏览文件 @
7d1ccd3e
...
...
@@ -31,7 +31,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
,
IEditorGroupView
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorGroupsAccessor
,
IEditorGroup
TitleDimensions
,
IEditorGroup
View
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
EditorCommandsContextActionRunner
,
IEditorCommandsContext
,
IEditorInput
,
toResource
,
IEditorPartOptions
,
SideBySideEditor
,
ActiveEditorPinnedContext
,
ActiveEditorStickyContext
}
from
'
vs/workbench/common/editor
'
;
import
{
ResourceContextKey
}
from
'
vs/workbench/common/resources
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
...
...
@@ -409,7 +409,7 @@ export abstract class TitleControl extends Themable {
abstract
layout
(
dimension
:
Dimension
):
void
;
abstract
get
PreferredHeight
():
number
;
abstract
get
Dimensions
():
IEditorGroupTitleDimensions
;
dispose
():
void
{
dispose
(
this
.
breadcrumbsControl
);
...
...
src/vs/workbench/test/browser/workbenchTestServices.ts
浏览文件 @
7d1ccd3e
...
...
@@ -11,7 +11,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
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupView
,
IEditorGroupsAccessor
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
IEditorOpeningEvent
,
EditorServiceImpl
,
IEditorGroupView
,
IEditorGroupsAccessor
,
IEditorGroupTitleDimensions
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IBackupFileService
,
IResolvedBackup
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -602,7 +602,8 @@ export class TestEditorGroupView implements IEditorGroupView {
maximumWidth
!
:
number
;
minimumHeight
!
:
number
;
maximumHeight
!
:
number
;
preferredTitleHeight
!
:
number
;
titleDimensions
!
:
IEditorGroupTitleDimensions
;
isEmpty
=
true
;
isMinimized
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录