Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
12615dd2
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,发现更多精彩内容 >>
提交
12615dd2
编写于
6月 22, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove viewlet splitter
fixes #7954
上级
ef3eb76e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
88 addition
and
89 deletion
+88
-89
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+87
-87
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
...ts/extensions/electron-browser/extensions.contribution.ts
+1
-2
未找到文件。
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
12615dd2
...
...
@@ -12,7 +12,7 @@ import {Builder, $} from 'vs/base/browser/builder';
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
{
ActionsOrientation
,
ActionBar
,
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
CONTEXT
,
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
import
{
/*CONTEXT,*/
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
CompositeEvent
,
EventType
}
from
'
vs/workbench/common/events
'
;
import
{
ViewletDescriptor
,
ViewletRegistry
,
Extensions
as
ViewletExtensions
}
from
'
vs/workbench/browser/viewlet
'
;
...
...
@@ -27,15 +27,15 @@ import {IInstantiationService} from 'vs/platform/instantiation/common/instantiat
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
Scope
,
IActionBarRegistry
,
Extensions
as
ActionBarExtensions
,
prepareActions
}
from
'
vs/workbench/browser/actionBarRegistry
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
events
=
require
(
'
vs/base/common/events
'
);
//
import {Scope, IActionBarRegistry, Extensions as ActionBarExtensions, prepareActions} from 'vs/workbench/browser/actionBarRegistry';
//
import Severity from 'vs/base/common/severity';
//
import {IAction} from 'vs/base/common/actions';
//
import events = require('vs/base/common/events');
export
class
ActivitybarPart
extends
Part
implements
IActivityService
{
public
serviceId
=
IActivityService
;
private
viewletSwitcherBar
:
ActionBar
;
private
globalViewletSwitcherBar
:
ActionBar
;
//
private globalViewletSwitcherBar: ActionBar;
private
globalToolBar
:
ToolBar
;
private
activityActionItems
:
{
[
actionId
:
string
]:
IActionItem
;
};
private
viewletIdToActions
:
{
[
viewletId
:
string
]:
ActivityAction
;
};
...
...
@@ -108,7 +108,7 @@ export class ActivitybarPart extends Part implements IActivityService {
this
.
createViewletSwitcher
(
$result
.
clone
());
// Bottom Toolbar with action items for global actions
this
.
createGlobalToolBarArea
(
$result
.
clone
());
// not used currently
//
this.createGlobalToolBarArea($result.clone()); // not used currently
return
$result
;
}
...
...
@@ -124,12 +124,12 @@ export class ActivitybarPart extends Part implements IActivityService {
this
.
viewletSwitcherBar
.
getContainer
().
addClass
(
'
position-top
'
);
// Global viewlet switcher is right below
this
.
globalViewletSwitcherBar
=
new
ActionBar
(
div
,
{
actionItemProvider
:
(
action
:
Action
)
=>
this
.
activityActionItems
[
action
.
id
],
orientation
:
ActionsOrientation
.
VERTICAL
,
ariaLabel
:
nls
.
localize
(
'
globalActivityBarAriaLabel
'
,
"
Active Global View Switcher
"
)
});
this
.
globalViewletSwitcherBar
.
getContainer
().
addClass
(
'
position-bottom
'
);
//
this.globalViewletSwitcherBar = new ActionBar(div, {
//
actionItemProvider: (action: Action) => this.activityActionItems[action.id],
//
orientation: ActionsOrientation.VERTICAL,
//
ariaLabel: nls.localize('globalActivityBarAriaLabel', "Active Global View Switcher")
//
});
//
this.globalViewletSwitcherBar.getContainer().addClass('position-bottom');
// Build Viewlet Actions in correct order
const
activeViewlet
=
this
.
viewletService
.
getActiveViewlet
();
...
...
@@ -165,82 +165,82 @@ export class ActivitybarPart extends Part implements IActivityService {
,
actionOptions
);
// Add to viewlet switcher
this
.
globalViewletSwitcherBar
.
push
(
allViewletActions
.
filter
(
v
=>
v
.
isGlobal
)
.
sort
((
v1
,
v2
)
=>
v1
.
order
-
v2
.
order
)
.
map
(
toAction
),
actionOptions
);
}
private
createGlobalToolBarArea
(
div
:
Builder
):
void
{
// Global action bar is on the bottom
this
.
globalToolBar
=
new
ToolBar
(
div
.
getHTMLElement
(),
this
.
contextMenuService
,
{
actionItemProvider
:
(
action
:
Action
)
=>
this
.
activityActionItems
[
action
.
id
],
orientation
:
ActionsOrientation
.
VERTICAL
});
this
.
globalToolBar
.
getContainer
().
addClass
(
'
global
'
);
this
.
globalToolBar
.
actionRunner
.
addListener2
(
events
.
EventType
.
RUN
,
(
e
:
any
)
=>
{
// Check for Error
if
(
e
.
error
&&
!
errors
.
isPromiseCanceledError
(
e
.
error
))
{
this
.
messageService
.
show
(
Severity
.
Error
,
e
.
error
);
}
// Log in telemetry
if
(
this
.
telemetryService
)
{
this
.
telemetryService
.
publicLog
(
'
workbenchActionExecuted
'
,
{
id
:
e
.
action
.
id
,
from
:
'
activityBar
'
});
}
});
// Build Global Actions in correct order
let
primaryActions
=
this
.
getGlobalActions
(
true
);
let
secondaryActions
=
this
.
getGlobalActions
(
false
);
if
(
primaryActions
.
length
+
secondaryActions
.
length
>
0
)
{
this
.
globalToolBar
.
getContainer
().
addClass
(
'
position-bottom
'
);
}
// Add to global action bar
this
.
globalToolBar
.
setActions
(
prepareActions
(
primaryActions
),
prepareActions
(
secondaryActions
))();
// this.globalViewletSwitcherBar.push(allViewletActions
// .filter(v => v.isGlobal)
// .sort((v1, v2) => v1.order - v2.order)
// .map(toAction),
// actionOptions);
}
private
getGlobalActions
(
primary
:
boolean
):
IAction
[]
{
let
actionBarRegistry
=
<
IActionBarRegistry
>
Registry
.
as
(
ActionBarExtensions
.
Actionbar
);
// Collect actions from actionbar contributor
let
actions
:
IAction
[];
if
(
primary
)
{
actions
=
actionBarRegistry
.
getActionBarActionsForContext
(
Scope
.
GLOBAL
,
CONTEXT
);
}
else
{
actions
=
actionBarRegistry
.
getSecondaryActionBarActionsForContext
(
Scope
.
GLOBAL
,
CONTEXT
);
}
return
actions
.
map
((
action
:
Action
)
=>
{
if
(
primary
)
{
let
keybinding
:
string
=
null
;
let
keys
=
this
.
keybindingService
.
lookupKeybindings
(
action
.
id
).
map
(
k
=>
this
.
keybindingService
.
getLabelFor
(
k
));
if
(
keys
&&
keys
.
length
)
{
keybinding
=
keys
[
0
];
}
let
actionItem
=
actionBarRegistry
.
getActionItemForContext
(
Scope
.
GLOBAL
,
CONTEXT
,
action
);
if
(
!
actionItem
)
{
actionItem
=
new
ActivityActionItem
(
action
,
action
.
label
,
keybinding
);
}
if
(
actionItem
instanceof
ActivityActionItem
)
{
(
<
ActivityActionItem
>
actionItem
).
keybinding
=
keybinding
;
}
this
.
activityActionItems
[
action
.
id
]
=
actionItem
;
}
return
action
;
});
}
// private createGlobalToolBarArea(div: Builder): void {
// // Global action bar is on the bottom
// this.globalToolBar = new ToolBar(div.getHTMLElement(), this.contextMenuService, {
// actionItemProvider: (action: Action) => this.activityActionItems[action.id],
// orientation: ActionsOrientation.VERTICAL
// });
// this.globalToolBar.getContainer().addClass('global');
// this.globalToolBar.actionRunner.addListener2(events.EventType.RUN, (e: any) => {
// // Check for Error
// if (e.error && !errors.isPromiseCanceledError(e.error)) {
// this.messageService.show(Severity.Error, e.error);
// }
// // Log in telemetry
// if (this.telemetryService) {
// this.telemetryService.publicLog('workbenchActionExecuted', { id: e.action.id, from: 'activityBar' });
// }
// });
// // Build Global Actions in correct order
// let primaryActions = this.getGlobalActions(true);
// let secondaryActions = this.getGlobalActions(false);
// if (primaryActions.length + secondaryActions.length > 0) {
// this.globalToolBar.getContainer().addClass('position-bottom');
// }
// // Add to global action bar
// this.globalToolBar.setActions(prepareActions(primaryActions), prepareActions(secondaryActions))();
// }
// private getGlobalActions(primary: boolean): IAction[] {
// let actionBarRegistry = <IActionBarRegistry>Registry.as(ActionBarExtensions.Actionbar);
// // Collect actions from actionbar contributor
// let actions: IAction[];
// if (primary) {
// actions = actionBarRegistry.getActionBarActionsForContext(Scope.GLOBAL, CONTEXT);
// } else {
// actions = actionBarRegistry.getSecondaryActionBarActionsForContext(Scope.GLOBAL, CONTEXT);
// }
// return actions.map((action: Action) => {
// if (primary) {
// let keybinding: string = null;
// let keys = this.keybindingService.lookupKeybindings(action.id).map(k => this.keybindingService.getLabelFor(k));
// if (keys && keys.length) {
// keybinding = keys[0];
// }
// let actionItem = actionBarRegistry.getActionItemForContext(Scope.GLOBAL, CONTEXT, action);
// if (!actionItem) {
// actionItem = new ActivityActionItem(action, action.label, keybinding);
// }
// if (actionItem instanceof ActivityActionItem) {
// (<ActivityActionItem> actionItem).keybinding = keybinding;
// }
// this.activityActionItems[action.id] = actionItem;
// }
// return action;
// });
// }
public
dispose
():
void
{
if
(
this
.
viewletSwitcherBar
)
{
...
...
src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts
浏览文件 @
12615dd2
...
...
@@ -62,8 +62,7 @@ const viewletDescriptor = new ViewletDescriptor(
'
workbench.viewlet.extensions
'
,
localize
(
'
extensions
'
,
"
Extensions
"
),
'
extensions
'
,
100
,
true
100
);
Registry
.
as
<
ViewletRegistry
>
(
ViewletExtensions
.
Viewlets
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录