Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
85dd1346
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,发现更多精彩内容 >>
提交
85dd1346
编写于
11月 20, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve dropdown menu placement for sidebar parts
上级
3af878c2
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
40 addition
and
9 deletion
+40
-9
src/vs/base/browser/contextmenu.ts
src/vs/base/browser/contextmenu.ts
+2
-0
src/vs/base/browser/ui/dropdown/dropdown.ts
src/vs/base/browser/ui/dropdown/dropdown.ts
+13
-6
src/vs/base/browser/ui/menu/menu.ts
src/vs/base/browser/ui/menu/menu.ts
+2
-0
src/vs/base/browser/ui/toolbar/toolbar.ts
src/vs/base/browser/ui/toolbar/toolbar.ts
+4
-1
src/vs/platform/contextview/browser/contextMenuHandler.ts
src/vs/platform/contextview/browser/contextMenuHandler.ts
+1
-0
src/vs/platform/contextview/browser/contextView.ts
src/vs/platform/contextview/browser/contextView.ts
+3
-0
src/vs/workbench/browser/parts/compositePart.ts
src/vs/workbench/browser/parts/compositePart.ts
+7
-1
src/vs/workbench/browser/parts/editor/titleControl.ts
src/vs/workbench/browser/parts/editor/titleControl.ts
+3
-1
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
+5
-0
未找到文件。
src/vs/base/browser/contextmenu.ts
浏览文件 @
85dd1346
...
@@ -7,6 +7,7 @@ import { IAction, IActionRunner } from 'vs/base/common/actions';
...
@@ -7,6 +7,7 @@ import { IAction, IActionRunner } from 'vs/base/common/actions';
import
{
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
SubmenuAction
}
from
'
vs/base/browser/ui/menu/menu
'
;
import
{
SubmenuAction
}
from
'
vs/base/browser/ui/menu/menu
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
export
interface
IContextMenuEvent
{
export
interface
IContextMenuEvent
{
shiftKey
?:
boolean
;
shiftKey
?:
boolean
;
...
@@ -31,4 +32,5 @@ export interface IContextMenuDelegate {
...
@@ -31,4 +32,5 @@ export interface IContextMenuDelegate {
onHide
?(
didCancel
:
boolean
):
void
;
onHide
?(
didCancel
:
boolean
):
void
;
actionRunner
?:
IActionRunner
;
actionRunner
?:
IActionRunner
;
autoSelectFirstItem
?:
boolean
;
autoSelectFirstItem
?:
boolean
;
anchorAlignment
?:
AnchorAlignment
;
}
}
src/vs/base/browser/ui/dropdown/dropdown.ts
浏览文件 @
85dd1346
...
@@ -8,7 +8,7 @@ import { Gesture, EventType as GestureEventType } from 'vs/base/browser/touch';
...
@@ -8,7 +8,7 @@ import { Gesture, EventType as GestureEventType } from 'vs/base/browser/touch';
import
{
ActionRunner
,
IAction
,
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
ActionRunner
,
IAction
,
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
BaseActionItem
,
IActionItemProvider
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
BaseActionItem
,
IActionItemProvider
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IContextViewProvider
,
IAnchor
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
IContextViewProvider
,
IAnchor
,
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
IMenuOptions
}
from
'
vs/base/browser/ui/menu/menu
'
;
import
{
IMenuOptions
}
from
'
vs/base/browser/ui/menu/menu
'
;
import
{
ResolvedKeybinding
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybinding
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
EventHelper
,
EventType
,
removeClass
,
addClass
,
append
,
$
,
addDisposableListener
,
addClasses
}
from
'
vs/base/browser/dom
'
;
import
{
EventHelper
,
EventType
,
removeClass
,
addClass
,
append
,
$
,
addDisposableListener
,
addClasses
}
from
'
vs/base/browser/dom
'
;
...
@@ -249,7 +249,8 @@ export class DropdownMenu extends BaseDropdown {
...
@@ -249,7 +249,8 @@ export class DropdownMenu extends BaseDropdown {
getKeyBinding
:
action
=>
this
.
menuOptions
&&
this
.
menuOptions
.
getKeyBinding
?
this
.
menuOptions
.
getKeyBinding
(
action
)
:
null
,
getKeyBinding
:
action
=>
this
.
menuOptions
&&
this
.
menuOptions
.
getKeyBinding
?
this
.
menuOptions
.
getKeyBinding
(
action
)
:
null
,
getMenuClassName
:
()
=>
this
.
menuClassName
,
getMenuClassName
:
()
=>
this
.
menuClassName
,
onHide
:
()
=>
this
.
onHide
(),
onHide
:
()
=>
this
.
onHide
(),
actionRunner
:
this
.
menuOptions
?
this
.
menuOptions
.
actionRunner
:
null
actionRunner
:
this
.
menuOptions
?
this
.
menuOptions
.
actionRunner
:
null
,
anchorAlignment
:
this
.
menuOptions
.
anchorAlignment
});
});
}
}
...
@@ -270,10 +271,11 @@ export class DropdownMenuActionItem extends BaseActionItem {
...
@@ -270,10 +271,11 @@ export class DropdownMenuActionItem extends BaseActionItem {
private
actionItemProvider
:
IActionItemProvider
;
private
actionItemProvider
:
IActionItemProvider
;
private
keybindings
:
(
action
:
IAction
)
=>
ResolvedKeybinding
;
private
keybindings
:
(
action
:
IAction
)
=>
ResolvedKeybinding
;
private
clazz
:
string
;
private
clazz
:
string
;
private
anchorAlignmentProvider
:
()
=>
AnchorAlignment
;
constructor
(
action
:
IAction
,
menuActions
:
IAction
[],
contextMenuProvider
:
IContextMenuProvider
,
actionItemProvider
:
IActionItemProvider
,
actionRunner
:
IActionRunner
,
keybindings
:
(
action
:
IAction
)
=>
ResolvedKeybinding
,
clazz
:
string
);
constructor
(
action
:
IAction
,
menuActions
:
IAction
[],
contextMenuProvider
:
IContextMenuProvider
,
actionItemProvider
:
IActionItemProvider
,
actionRunner
:
IActionRunner
,
keybindings
:
(
action
:
IAction
)
=>
ResolvedKeybinding
,
clazz
:
string
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
);
constructor
(
action
:
IAction
,
actionProvider
:
IActionProvider
,
contextMenuProvider
:
IContextMenuProvider
,
actionItemProvider
:
IActionItemProvider
,
actionRunner
:
IActionRunner
,
keybindings
:
(
action
:
IAction
)
=>
ResolvedKeybinding
,
clazz
:
string
);
constructor
(
action
:
IAction
,
actionProvider
:
IActionProvider
,
contextMenuProvider
:
IContextMenuProvider
,
actionItemProvider
:
IActionItemProvider
,
actionRunner
:
IActionRunner
,
keybindings
:
(
action
:
IAction
)
=>
ResolvedKeybinding
,
clazz
:
string
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
);
constructor
(
action
:
IAction
,
menuActionsOrProvider
:
any
,
contextMenuProvider
:
IContextMenuProvider
,
actionItemProvider
:
IActionItemProvider
,
actionRunner
:
IActionRunner
,
keybindings
:
(
action
:
IAction
)
=>
ResolvedKeybinding
,
clazz
:
string
)
{
constructor
(
action
:
IAction
,
menuActionsOrProvider
:
any
,
contextMenuProvider
:
IContextMenuProvider
,
actionItemProvider
:
IActionItemProvider
,
actionRunner
:
IActionRunner
,
keybindings
:
(
action
:
IAction
)
=>
ResolvedKeybinding
,
clazz
:
string
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
)
{
super
(
null
,
action
);
super
(
null
,
action
);
this
.
menuActionsOrProvider
=
menuActionsOrProvider
;
this
.
menuActionsOrProvider
=
menuActionsOrProvider
;
...
@@ -282,6 +284,7 @@ export class DropdownMenuActionItem extends BaseActionItem {
...
@@ -282,6 +284,7 @@ export class DropdownMenuActionItem extends BaseActionItem {
this
.
actionRunner
=
actionRunner
;
this
.
actionRunner
=
actionRunner
;
this
.
keybindings
=
keybindings
;
this
.
keybindings
=
keybindings
;
this
.
clazz
=
clazz
;
this
.
clazz
=
clazz
;
this
.
anchorAlignmentProvider
=
anchorAlignmentProvider
;
}
}
render
(
container
:
HTMLElement
):
void
{
render
(
container
:
HTMLElement
):
void
{
...
@@ -311,11 +314,15 @@ export class DropdownMenuActionItem extends BaseActionItem {
...
@@ -311,11 +314,15 @@ export class DropdownMenuActionItem extends BaseActionItem {
this
.
dropdownMenu
=
this
.
_register
(
new
DropdownMenu
(
container
,
options
));
this
.
dropdownMenu
=
this
.
_register
(
new
DropdownMenu
(
container
,
options
));
const
that
=
this
;
this
.
dropdownMenu
.
menuOptions
=
{
this
.
dropdownMenu
.
menuOptions
=
{
actionItemProvider
:
this
.
actionItemProvider
,
actionItemProvider
:
this
.
actionItemProvider
,
actionRunner
:
this
.
actionRunner
,
actionRunner
:
this
.
actionRunner
,
getKeyBinding
:
this
.
keybindings
,
getKeyBinding
:
this
.
keybindings
,
context
:
this
.
_context
context
:
this
.
_context
,
get
anchorAlignment
():
AnchorAlignment
{
return
that
.
anchorAlignmentProvider
();
}
};
};
}
}
...
...
src/vs/base/browser/ui/menu/menu.ts
浏览文件 @
85dd1346
...
@@ -14,6 +14,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
...
@@ -14,6 +14,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
export
const
MENU_MNEMONIC_REGEX
:
RegExp
=
/
\(
&
{1,2}(
.
)\)
|&
{1,2}(
.
)
/
;
export
const
MENU_MNEMONIC_REGEX
:
RegExp
=
/
\(
&
{1,2}(
.
)\)
|&
{1,2}(
.
)
/
;
export
const
MENU_ESCAPED_MNEMONIC_REGEX
:
RegExp
=
/
(?:
&
){1,2}(
.
)
/
;
export
const
MENU_ESCAPED_MNEMONIC_REGEX
:
RegExp
=
/
(?:
&
){1,2}(
.
)
/
;
...
@@ -25,6 +26,7 @@ export interface IMenuOptions {
...
@@ -25,6 +26,7 @@ export interface IMenuOptions {
getKeyBinding
?:
(
action
:
IAction
)
=>
ResolvedKeybinding
;
getKeyBinding
?:
(
action
:
IAction
)
=>
ResolvedKeybinding
;
ariaLabel
?:
string
;
ariaLabel
?:
string
;
enableMnemonics
?:
boolean
;
enableMnemonics
?:
boolean
;
anchorAlignment
?:
AnchorAlignment
;
}
}
export
interface
IMenuStyles
{
export
interface
IMenuStyles
{
...
...
src/vs/base/browser/ui/toolbar/toolbar.ts
浏览文件 @
85dd1346
...
@@ -10,6 +10,7 @@ import { ActionBar, ActionsOrientation, IActionItemProvider } from 'vs/base/brow
...
@@ -10,6 +10,7 @@ import { ActionBar, ActionsOrientation, IActionItemProvider } from 'vs/base/brow
import
{
IContextMenuProvider
,
DropdownMenuActionItem
}
from
'
vs/base/browser/ui/dropdown/dropdown
'
;
import
{
IContextMenuProvider
,
DropdownMenuActionItem
}
from
'
vs/base/browser/ui/dropdown/dropdown
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
ResolvedKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
export
const
CONTEXT
=
'
context.toolbar
'
;
export
const
CONTEXT
=
'
context.toolbar
'
;
...
@@ -20,6 +21,7 @@ export interface IToolBarOptions {
...
@@ -20,6 +21,7 @@ export interface IToolBarOptions {
getKeyBinding
?:
(
action
:
IAction
)
=>
ResolvedKeybinding
;
getKeyBinding
?:
(
action
:
IAction
)
=>
ResolvedKeybinding
;
actionRunner
?:
IActionRunner
;
actionRunner
?:
IActionRunner
;
toggleMenuTitle
?:
string
;
toggleMenuTitle
?:
string
;
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
;
}
}
/**
/**
...
@@ -67,7 +69,8 @@ export class ToolBar extends Disposable {
...
@@ -67,7 +69,8 @@ export class ToolBar extends Disposable {
this
.
options
.
actionItemProvider
,
this
.
options
.
actionItemProvider
,
this
.
actionRunner
,
this
.
actionRunner
,
this
.
options
.
getKeyBinding
,
this
.
options
.
getKeyBinding
,
'
toolbar-toggle-more
'
'
toolbar-toggle-more
'
,
this
.
options
.
anchorAlignmentProvider
);
);
this
.
toggleMenuActionItem
.
setActionContext
(
this
.
actionBar
.
context
);
this
.
toggleMenuActionItem
.
setActionContext
(
this
.
actionBar
.
context
);
...
...
src/vs/platform/contextview/browser/contextMenuHandler.ts
浏览文件 @
85dd1346
...
@@ -60,6 +60,7 @@ export class ContextMenuHandler {
...
@@ -60,6 +60,7 @@ export class ContextMenuHandler {
this
.
contextViewService
.
showContextView
({
this
.
contextViewService
.
showContextView
({
getAnchor
:
()
=>
delegate
.
getAnchor
(),
getAnchor
:
()
=>
delegate
.
getAnchor
(),
canRelayout
:
false
,
canRelayout
:
false
,
anchorAlignment
:
delegate
.
anchorAlignment
,
render
:
(
container
)
=>
{
render
:
(
container
)
=>
{
this
.
menuContainerElement
=
container
;
this
.
menuContainerElement
=
container
;
...
...
src/vs/platform/contextview/browser/contextView.ts
浏览文件 @
85dd1346
...
@@ -7,6 +7,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
...
@@ -7,6 +7,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IContextMenuDelegate
}
from
'
vs/base/browser/contextmenu
'
;
import
{
IContextMenuDelegate
}
from
'
vs/base/browser/contextmenu
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
export
const
IContextViewService
=
createDecorator
<
IContextViewService
>
(
'
contextViewService
'
);
export
const
IContextViewService
=
createDecorator
<
IContextViewService
>
(
'
contextViewService
'
);
...
@@ -17,6 +18,7 @@ export interface IContextViewService {
...
@@ -17,6 +18,7 @@ export interface IContextViewService {
showContextView
(
delegate
:
IContextViewDelegate
):
void
;
showContextView
(
delegate
:
IContextViewDelegate
):
void
;
hideContextView
(
data
?:
any
):
void
;
hideContextView
(
data
?:
any
):
void
;
layout
():
void
;
layout
():
void
;
anchorAlignment
?:
AnchorAlignment
;
}
}
export
interface
IContextViewDelegate
{
export
interface
IContextViewDelegate
{
...
@@ -27,6 +29,7 @@ export interface IContextViewDelegate {
...
@@ -27,6 +29,7 @@ export interface IContextViewDelegate {
render
(
container
:
HTMLElement
):
IDisposable
;
render
(
container
:
HTMLElement
):
IDisposable
;
onDOMEvent
?(
e
:
any
,
activeElement
:
HTMLElement
):
void
;
onDOMEvent
?(
e
:
any
,
activeElement
:
HTMLElement
):
void
;
onHide
?(
data
?:
any
):
void
;
onHide
?(
data
?:
any
):
void
;
anchorAlignment
?:
AnchorAlignment
;
}
}
export
const
IContextMenuService
=
createDecorator
<
IContextMenuService
>
(
'
contextMenuService
'
);
export
const
IContextMenuService
=
createDecorator
<
IContextMenuService
>
(
'
contextMenuService
'
);
...
...
src/vs/workbench/browser/parts/compositePart.ts
浏览文件 @
85dd1346
...
@@ -31,6 +31,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
...
@@ -31,6 +31,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import
{
attachProgressBarStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
attachProgressBarStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
Dimension
,
append
,
$
,
addClass
,
hide
,
show
,
addClasses
}
from
'
vs/base/browser/dom
'
;
import
{
Dimension
,
append
,
$
,
addClass
,
hide
,
show
,
addClasses
}
from
'
vs/base/browser/dom
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
export
interface
ICompositeTitleLabel
{
export
interface
ICompositeTitleLabel
{
...
@@ -391,7 +392,8 @@ export abstract class CompositePart<T extends Composite> extends Part {
...
@@ -391,7 +392,8 @@ export abstract class CompositePart<T extends Composite> extends Part {
this
.
toolBar
=
this
.
_register
(
new
ToolBar
(
titleActionsContainer
,
this
.
contextMenuService
,
{
this
.
toolBar
=
this
.
_register
(
new
ToolBar
(
titleActionsContainer
,
this
.
contextMenuService
,
{
actionItemProvider
:
action
=>
this
.
actionItemProvider
(
action
as
Action
),
actionItemProvider
:
action
=>
this
.
actionItemProvider
(
action
as
Action
),
orientation
:
ActionsOrientation
.
HORIZONTAL
,
orientation
:
ActionsOrientation
.
HORIZONTAL
,
getKeyBinding
:
action
=>
this
.
keybindingService
.
lookupKeybinding
(
action
.
id
)
getKeyBinding
:
action
=>
this
.
keybindingService
.
lookupKeybinding
(
action
.
id
),
anchorAlignmentProvider
:
()
=>
this
.
getTitleAreaDropDownAnchorAlignment
()
}));
}));
return
titleArea
;
return
titleArea
;
...
@@ -453,6 +455,10 @@ export abstract class CompositePart<T extends Composite> extends Part {
...
@@ -453,6 +455,10 @@ export abstract class CompositePart<T extends Composite> extends Part {
return
[];
return
[];
}
}
protected
getTitleAreaDropDownAnchorAlignment
():
AnchorAlignment
{
return
AnchorAlignment
.
RIGHT
;
}
layout
(
dimension
:
Dimension
):
Dimension
[]
{
layout
(
dimension
:
Dimension
):
Dimension
[]
{
// Pass to super
// Pass to super
...
...
src/vs/workbench/browser/parts/editor/titleControl.ts
浏览文件 @
85dd1346
...
@@ -37,6 +37,7 @@ import { EditorCommandsContextActionRunner, IEditorCommandsContext, IEditorInput
...
@@ -37,6 +37,7 @@ import { EditorCommandsContextActionRunner, IEditorCommandsContext, IEditorInput
import
{
ResourceContextKey
}
from
'
vs/workbench/common/resources
'
;
import
{
ResourceContextKey
}
from
'
vs/workbench/common/resources
'
;
import
{
Themable
}
from
'
vs/workbench/common/theme
'
;
import
{
Themable
}
from
'
vs/workbench/common/theme
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
export
interface
IToolbarActions
{
export
interface
IToolbarActions
{
primary
:
IAction
[];
primary
:
IAction
[];
...
@@ -119,7 +120,8 @@ export abstract class TitleControl extends Themable {
...
@@ -119,7 +120,8 @@ export abstract class TitleControl extends Themable {
orientation
:
ActionsOrientation
.
HORIZONTAL
,
orientation
:
ActionsOrientation
.
HORIZONTAL
,
ariaLabel
:
localize
(
'
araLabelEditorActions
'
,
"
Editor actions
"
),
ariaLabel
:
localize
(
'
araLabelEditorActions
'
,
"
Editor actions
"
),
getKeyBinding
:
action
=>
this
.
getKeybinding
(
action
),
getKeyBinding
:
action
=>
this
.
getKeybinding
(
action
),
actionRunner
:
this
.
_register
(
new
EditorCommandsContextActionRunner
(
context
))
actionRunner
:
this
.
_register
(
new
EditorCommandsContextActionRunner
(
context
)),
anchorAlignmentProvider
:
()
=>
AnchorAlignment
.
RIGHT
}));
}));
// Context
// Context
...
...
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
浏览文件 @
85dd1346
...
@@ -29,6 +29,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
...
@@ -29,6 +29,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import
{
Dimension
,
EventType
,
addDisposableListener
,
trackFocus
}
from
'
vs/base/browser/dom
'
;
import
{
Dimension
,
EventType
,
addDisposableListener
,
trackFocus
}
from
'
vs/base/browser/dom
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
RawContextKey
,
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
RawContextKey
,
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
AnchorAlignment
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
const
SideBarFocusContextId
=
'
sideBarFocus
'
;
const
SideBarFocusContextId
=
'
sideBarFocus
'
;
export
const
SidebarFocusContext
=
new
RawContextKey
<
boolean
>
(
SideBarFocusContextId
,
false
);
export
const
SidebarFocusContext
=
new
RawContextKey
<
boolean
>
(
SideBarFocusContextId
,
false
);
...
@@ -162,6 +163,10 @@ export class SidebarPart extends CompositePart<Viewlet> {
...
@@ -162,6 +163,10 @@ export class SidebarPart extends CompositePart<Viewlet> {
return
super
.
layout
(
dimension
);
return
super
.
layout
(
dimension
);
}
}
protected
getTitleAreaDropDownAnchorAlignment
():
AnchorAlignment
{
return
this
.
partService
.
getSideBarPosition
()
===
SideBarPosition
.
LEFT
?
AnchorAlignment
.
LEFT
:
AnchorAlignment
.
RIGHT
;
}
private
onTitleAreaContextMenu
(
event
:
StandardMouseEvent
):
void
{
private
onTitleAreaContextMenu
(
event
:
StandardMouseEvent
):
void
{
const
activeViewlet
=
this
.
getActiveViewlet
()
as
Viewlet
;
const
activeViewlet
=
this
.
getActiveViewlet
()
as
Viewlet
;
if
(
activeViewlet
)
{
if
(
activeViewlet
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录