Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1cef0f3c
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,发现更多精彩内容 >>
提交
1cef0f3c
编写于
7月 14, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Regression 1.3] Command palette no longer mouse-accessible (fixes #8913)
上级
5dc69d3b
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
41 addition
and
17 deletion
+41
-17
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
+4
-0
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
+17
-13
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
...workbench/browser/parts/editor/sideBySideEditorControl.ts
+6
-1
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+4
-2
src/vs/workbench/browser/parts/editor/titleControl.ts
src/vs/workbench/browser/parts/editor/titleControl.ts
+10
-1
未找到文件。
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
浏览文件 @
1cef0f3c
...
...
@@ -24,6 +24,10 @@
cursor
:
pointer
;
}
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.title-label
span
{
cursor
:
pointer
;
}
.vs
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.title-label
a
,
.vs
.monaco-workbench
>
.part.editor
>
.content
>
.one-editor-silo
>
.container
>
.title
.tabs-container
>
.tab
.tab-label
a
{
color
:
rgba
(
51
,
51
,
51
,
0.5
);
...
...
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
浏览文件 @
1cef0f3c
...
...
@@ -26,7 +26,6 @@ export class NoTabsTitleControl extends TitleControl {
private
currentPrimaryEditorActionIds
:
string
[]
=
[];
private
currentSecondaryEditorActionIds
:
string
[]
=
[];
public
setContext
(
group
:
IEditorGroup
):
void
{
super
.
setContext
(
group
);
...
...
@@ -39,18 +38,10 @@ export class NoTabsTitleControl extends TitleControl {
this
.
titleContainer
=
parent
;
// Pin on double click
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
titleContainer
,
DOM
.
EventType
.
DBLCLICK
,
(
e
:
MouseEvent
)
=>
{
DOM
.
EventHelper
.
stop
(
e
);
this
.
onTitleDoubleClick
();
}));
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
titleContainer
,
DOM
.
EventType
.
DBLCLICK
,
(
e
:
MouseEvent
)
=>
this
.
onTitleDoubleClick
(
e
)));
// Detect mouse click
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
titleContainer
,
DOM
.
EventType
.
MOUSE_UP
,
(
e
:
MouseEvent
)
=>
{
DOM
.
EventHelper
.
stop
(
e
,
false
);
this
.
onTitleClick
(
e
);
}));
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
titleContainer
,
DOM
.
EventType
.
MOUSE_UP
,
(
e
:
MouseEvent
)
=>
this
.
onTitleClick
(
e
)));
// Left Title Decoration
this
.
titleDecoration
=
document
.
createElement
(
'
div
'
);
...
...
@@ -67,6 +58,10 @@ export class NoTabsTitleControl extends TitleControl {
this
.
titleDescription
=
document
.
createElement
(
'
span
'
);
labelContainer
.
appendChild
(
this
.
titleDescription
);
// Detect title label & description click
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
titleLabel
,
DOM
.
EventType
.
CLICK
,
(
e
:
MouseEvent
)
=>
this
.
onTitleLabelClick
(
e
)));
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
titleDescription
,
DOM
.
EventType
.
CLICK
,
(
e
:
MouseEvent
)
=>
this
.
onTitleLabelClick
(
e
)));
this
.
titleContainer
.
appendChild
(
labelContainer
);
// Right Actions Container
...
...
@@ -81,7 +76,15 @@ export class NoTabsTitleControl extends TitleControl {
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
titleContainer
,
DOM
.
EventType
.
CONTEXT_MENU
,
(
e
:
Event
)
=>
this
.
onContextMenu
({
group
:
this
.
context
,
editor
:
this
.
context
.
activeEditor
},
e
,
this
.
titleContainer
)));
}
private
onTitleDoubleClick
():
void
{
private
onTitleLabelClick
(
e
:
MouseEvent
):
void
{
DOM
.
EventHelper
.
stop
(
e
,
false
);
if
(
!
this
.
dragged
)
{
this
.
quickOpenService
.
show
();
}
}
private
onTitleDoubleClick
(
e
:
MouseEvent
):
void
{
DOM
.
EventHelper
.
stop
(
e
);
if
(
!
this
.
context
)
{
return
;
}
...
...
@@ -92,6 +95,7 @@ export class NoTabsTitleControl extends TitleControl {
}
private
onTitleClick
(
e
:
MouseEvent
):
void
{
DOM
.
EventHelper
.
stop
(
e
,
false
);
if
(
!
this
.
context
)
{
return
;
}
...
...
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
浏览文件 @
1cef0f3c
...
...
@@ -1057,12 +1057,14 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
// Allow to reorder positions by dragging the title
titleContainer
.
on
(
DOM
.
EventType
.
MOUSE_DOWN
,
(
e
:
MouseEvent
)
=>
{
const
position
=
this
.
findPosition
(
titleContainer
.
getHTMLElement
());
if
(
!
this
.
getTitleAreaControl
(
position
).
allowDragging
(
<
any
>
e
.
target
||
e
.
srcElement
))
{
const
titleAreaControl
=
this
.
getTitleAreaControl
(
position
);
if
(
!
titleAreaControl
.
allowDragging
(
<
any
>
e
.
target
||
e
.
srcElement
))
{
return
;
// return early if we are not in the drag zone of the title widget
}
// Reset flag
wasDragged
=
false
;
titleAreaControl
.
setDragged
(
false
);
// Return early if there is only one editor active or the user clicked into the toolbar
if
(
this
.
getVisibleEditorCount
()
<=
1
)
{
...
...
@@ -1206,6 +1208,9 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
// Update flag
this
.
dragging
=
false
;
if
(
wasDragged
)
{
titleAreaControl
.
setDragged
(
true
);
}
// Restore styles
this
.
parent
.
removeClass
(
'
drag
'
);
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
1cef0f3c
...
...
@@ -31,6 +31,7 @@ import {IInstantiationService} from 'vs/platform/instantiation/common/instantiat
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IMenuService
}
from
'
vs/platform/actions/common/actions
'
;
import
{
TitleControl
}
from
'
vs/workbench/browser/parts/editor/titleControl
'
;
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
ScrollableElement
}
from
'
vs/base/browser/ui/scrollbar/scrollableElement
'
;
import
{
ScrollbarVisibility
}
from
'
vs/base/common/scrollable
'
;
...
...
@@ -58,9 +59,10 @@ export class TabsTitleControl extends TitleControl {
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IMessageService
messageService
:
IMessageService
,
@
IMenuService
menuService
:
IMenuService
@
IMenuService
menuService
:
IMenuService
,
@
IQuickOpenService
quickOpenService
:
IQuickOpenService
)
{
super
(
contextMenuService
,
instantiationService
,
configurationService
,
editorService
,
editorGroupService
,
keybindingService
,
telemetryService
,
messageService
,
menuService
);
super
(
contextMenuService
,
instantiationService
,
configurationService
,
editorService
,
editorGroupService
,
keybindingService
,
telemetryService
,
messageService
,
menuService
,
quickOpenService
);
this
.
currentPrimaryGroupActionIds
=
[];
this
.
currentSecondaryGroupActionIds
=
[];
...
...
src/vs/workbench/browser/parts/editor/titleControl.ts
浏览文件 @
1cef0f3c
...
...
@@ -28,6 +28,7 @@ import {IMessageService, Severity} from 'vs/platform/message/common/message';
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
CloseEditorsInGroupAction
,
MoveGroupLeftAction
,
MoveGroupRightAction
,
SplitEditorAction
,
CloseEditorAction
,
KeepEditorAction
,
CloseOtherEditorsInGroupAction
,
CloseRightEditorsInGroupAction
,
ShowEditorsInGroupAction
}
from
'
vs/workbench/browser/parts/editor/editorActions
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -43,6 +44,7 @@ export interface IToolbarActions {
export
interface
ITitleAreaControl
{
setContext
(
group
:
IEditorGroup
):
void
;
allowDragging
(
element
:
HTMLElement
):
boolean
;
setDragged
(
dragged
:
boolean
):
void
;
create
(
parent
:
HTMLElement
):
void
;
getContainer
():
HTMLElement
;
refresh
(
instant
?:
boolean
):
void
;
...
...
@@ -59,6 +61,8 @@ export abstract class TitleControl implements ITitleAreaControl {
protected
context
:
IEditorGroup
;
protected
toDispose
:
IDisposable
[];
protected
dragged
:
boolean
;
protected
closeEditorAction
:
CloseEditorAction
;
protected
pinEditorAction
:
KeepEditorAction
;
protected
closeOtherEditorsAction
:
CloseOtherEditorsInGroupAction
;
...
...
@@ -91,7 +95,8 @@ export abstract class TitleControl implements ITitleAreaControl {
@
IKeybindingService
protected
keybindingService
:
IKeybindingService
,
@
ITelemetryService
protected
telemetryService
:
ITelemetryService
,
@
IMessageService
protected
messageService
:
IMessageService
,
@
IMenuService
protected
menuService
:
IMenuService
@
IMenuService
protected
menuService
:
IMenuService
,
@
IQuickOpenService
protected
quickOpenService
:
IQuickOpenService
)
{
this
.
toDispose
=
[];
this
.
stacks
=
editorGroupService
.
getStacksModel
();
...
...
@@ -116,6 +121,10 @@ export abstract class TitleControl implements ITitleAreaControl {
return
TitleControl
.
draggedEditor
;
}
public
setDragged
(
dragged
:
boolean
):
void
{
this
.
dragged
=
dragged
;
}
protected
onEditorDragStart
(
editor
:
IEditorIdentifier
):
void
{
TitleControl
.
draggedEditor
=
editor
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录