Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
b41f1811
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,发现更多精彩内容 >>
提交
b41f1811
编写于
3月 14, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish affordance to maximize panel
fixes #22135
上级
0f431e3d
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
62 addition
and
7 deletion
+62
-7
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+13
-3
src/vs/workbench/browser/parts/panel/media/down-inverse.svg
src/vs/workbench/browser/parts/panel/media/down-inverse.svg
+1
-0
src/vs/workbench/browser/parts/panel/media/down.svg
src/vs/workbench/browser/parts/panel/media/down.svg
+1
-0
src/vs/workbench/browser/parts/panel/media/panelpart.css
src/vs/workbench/browser/parts/panel/media/panelpart.css
+18
-0
src/vs/workbench/browser/parts/panel/media/up-inverse.svg
src/vs/workbench/browser/parts/panel/media/up-inverse.svg
+1
-0
src/vs/workbench/browser/parts/panel/media/up.svg
src/vs/workbench/browser/parts/panel/media/up.svg
+1
-0
src/vs/workbench/browser/parts/panel/panelActions.ts
src/vs/workbench/browser/parts/panel/panelActions.ts
+13
-2
src/vs/workbench/browser/parts/panel/panelPart.ts
src/vs/workbench/browser/parts/panel/panelPart.ts
+5
-2
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+4
-0
src/vs/workbench/services/part/common/partService.ts
src/vs/workbench/services/part/common/partService.ts
+5
-0
未找到文件。
src/vs/workbench/browser/layout.ts
浏览文件 @
b41f1811
...
...
@@ -71,6 +71,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
private
startPanelHeight
:
number
;
private
panelHeight
:
number
;
private
panelHeightBeforeMaximized
:
number
;
private
panelMaximized
:
boolean
;
private
panelWidth
:
number
;
private
layoutEditorGroupsVertically
:
boolean
;
...
...
@@ -107,6 +108,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this
.
toUnbind
=
[];
this
.
partLayoutInfo
=
this
.
getPartLayoutInfo
();
this
.
panelHeightBeforeMaximized
=
0
;
this
.
panelMaximized
=
false
;
this
.
sashX
=
new
Sash
(
this
.
workbenchContainer
.
getHTMLElement
(),
this
,
{
baseSize
:
5
...
...
@@ -342,9 +344,13 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
panelHeight
=
sidebarSize
.
height
*
DEFAULT_PANEL_HEIGHT_COEFFICIENT
;
}
if
(
options
&&
options
.
toggleMaximizedPanel
)
{
const
heightToSwap
=
panelHeight
;
panelHeight
=
panelHeight
===
maxPanelHeight
?
Math
.
max
(
this
.
partLayoutInfo
.
panel
.
minHeight
,
Math
.
min
(
this
.
panelHeightBeforeMaximized
,
maxPanelHeight
))
:
maxPanelHeight
;
this
.
panelHeightBeforeMaximized
=
heightToSwap
;
panelHeight
=
this
.
panelMaximized
?
Math
.
max
(
this
.
partLayoutInfo
.
panel
.
minHeight
,
Math
.
min
(
this
.
panelHeightBeforeMaximized
,
maxPanelHeight
))
:
maxPanelHeight
;
}
this
.
panelMaximized
=
panelHeight
===
maxPanelHeight
;
if
(
panelHeight
/
maxPanelHeight
<
0.7
)
{
// Remember the previous height only if the panel size is not too large.
// To get a nice minimize effect even if a user dragged the panel sash to maximum.
this
.
panelHeightBeforeMaximized
=
panelHeight
;
}
const
panelDimension
=
new
Dimension
(
this
.
workbenchSize
.
width
-
sidebarSize
.
width
-
activityBarSize
.
width
,
panelHeight
);
this
.
panelWidth
=
panelDimension
.
width
;
...
...
@@ -529,6 +535,10 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
return
this
.
panelWidth
;
}
public
isPanelMaximized
():
boolean
{
return
this
.
panelMaximized
;
}
public
dispose
():
void
{
if
(
this
.
toUnbind
)
{
dispose
(
this
.
toUnbind
);
...
...
src/vs/workbench/browser/parts/panel/media/down-inverse.svg
0 → 100755
浏览文件 @
b41f1811
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 16 16"
><style>
.icon-canvas-transparent{opacity:0;fill:#2d2d30}.icon-vs-out{fill:#2d2d30}.icon-vs-bg{fill:#c5c5c5}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16H0V0h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M.379 5.652l2.828-2.828 4.76 4.761 4.826-4.826 2.828 2.828-7.654 7.654L.379 5.652z"
id=
"outline"
style=
"display: none;"
/><g
id=
"iconBg"
><path
class=
"icon-vs-bg"
d=
"M7.967 11.827L1.793 5.652l1.414-1.414 4.76 4.761 4.826-4.826 1.414 1.414-6.24 6.24z"
/></g></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/panel/media/down.svg
0 → 100755
浏览文件 @
b41f1811
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 16 16"
><style>
.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-out{fill:#f6f6f6}.icon-vs-bg{fill:#424242}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16H0V0h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M.379 5.652l2.828-2.828 4.76 4.761 4.826-4.826 2.828 2.828-7.654 7.654L.379 5.652z"
id=
"outline"
style=
"display: none;"
/><g
id=
"iconBg"
><path
class=
"icon-vs-bg"
d=
"M7.967 11.827L1.793 5.652l1.414-1.414 4.76 4.761 4.826-4.826 1.414 1.414-6.24 6.24z"
/></g></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/panel/media/panelpart.css
浏览文件 @
b41f1811
...
...
@@ -70,6 +70,24 @@
background
:
url('close.svg')
center
center
no-repeat
;
}
.monaco-workbench
.maximize-panel-action
{
background
:
url('up.svg')
center
center
no-repeat
;
}
.vs-dark
.monaco-workbench
.maximize-panel-action
,
.hc-black
.monaco-workbench
.maximize-panel-action
{
background
:
url('up-inverse.svg')
center
center
no-repeat
;
}
.monaco-workbench
.minimize-panel-action
{
background
:
url('down.svg')
center
center
no-repeat
;
}
.vs-dark
.monaco-workbench
.minimize-panel-action
,
.hc-black
.monaco-workbench
.minimize-panel-action
{
background
:
url('down-inverse.svg')
center
center
no-repeat
;
}
.vs-dark
.monaco-workbench
.hide-panel-action
,
.hc-black
.monaco-workbench
.hide-panel-action
{
background
:
url('close-inverse.svg')
center
center
no-repeat
;
...
...
src/vs/workbench/browser/parts/panel/media/up-inverse.svg
0 → 100755
浏览文件 @
b41f1811
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 16 16"
><style>
.icon-canvas-transparent{opacity:0;fill:#2d2d30}.icon-vs-out{fill:#2d2d30}.icon-vs-bg{fill:#c5c5c5}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16H0V0h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M7.967 2.759l7.654 7.654-2.828 2.828-4.826-4.826-4.76 4.761-2.828-2.828 7.588-7.589z"
id=
"outline"
style=
"display: none;"
/><g
id=
"iconBg"
><path
class=
"icon-vs-bg"
d=
"M14.207 10.413l-1.414 1.414-4.826-4.826-4.76 4.761-1.414-1.414 6.174-6.175 6.24 6.24z"
/></g></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/panel/media/up.svg
0 → 100755
浏览文件 @
b41f1811
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 16 16"
><style>
.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-out{fill:#f6f6f6}.icon-vs-bg{fill:#424242}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16H0V0h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M7.967 2.759l7.654 7.654-2.828 2.828-4.826-4.826-4.76 4.761-2.828-2.828 7.588-7.589z"
id=
"outline"
style=
"display: none;"
/><g
id=
"iconBg"
><path
class=
"icon-vs-bg"
d=
"M14.207 10.413l-1.414 1.414-4.826-4.826-4.76 4.761-1.414-1.414 6.174-6.175 6.24 6.24z"
/></g></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/panel/panelActions.ts
浏览文件 @
b41f1811
...
...
@@ -6,6 +6,7 @@
import
'
vs/css!./media/panelpart
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
KeyMod
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
...
...
@@ -113,17 +114,22 @@ class FocusPanelAction extends Action {
}
}
class
ToggleMaximizedPanelAction
extends
Action
{
export
class
ToggleMaximizedPanelAction
extends
Action
{
public
static
ID
=
'
workbench.action.toggleMaximizedPanel
'
;
public
static
LABEL
=
nls
.
localize
(
'
toggleMaximizedPanel
'
,
"
Toggle Maximized Panel
"
);
private
toDispose
:
IDisposable
[];
constructor
(
id
:
string
,
label
:
string
,
@
IPartService
private
partService
:
IPartService
)
{
super
(
id
,
label
);
super
(
id
,
label
,
partService
.
isPanelMaximized
()
?
'
minimize-panel-action
'
:
'
maximize-panel-action
'
);
this
.
toDispose
=
[];
this
.
toDispose
.
push
(
partService
.
onEditorLayout
(()
=>
{
this
.
class
=
this
.
partService
.
isPanelMaximized
()
?
'
minimize-panel-action
'
:
'
maximize-panel-action
'
;
}));
}
public
run
():
TPromise
<
any
>
{
...
...
@@ -131,6 +137,11 @@ class ToggleMaximizedPanelAction extends Action {
return
this
.
partService
.
setPanelHidden
(
false
)
.
then
(()
=>
this
.
partService
.
toggleMaximizedPanel
());
}
public
dispose
():
void
{
super
.
dispose
();
this
.
toDispose
=
dispose
(
this
.
toDispose
);
}
}
const
actionRegistry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
WorkbenchExtensions
.
WorkbenchActions
);
...
...
src/vs/workbench/browser/parts/panel/panelPart.ts
浏览文件 @
b41f1811
...
...
@@ -23,7 +23,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ActionsOrientation
,
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ClosePanelAction
,
PanelAction
}
from
'
vs/workbench/browser/parts/panel/panelActions
'
;
import
{
ClosePanelAction
,
PanelAction
,
ToggleMaximizedPanelAction
}
from
'
vs/workbench/browser/parts/panel/panelActions
'
;
export
class
PanelPart
extends
CompositePart
<
Panel
>
implements
IPanelService
{
...
...
@@ -116,7 +116,10 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
}
protected
getActions
():
IAction
[]
{
return
[
this
.
instantiationService
.
createInstance
(
ClosePanelAction
,
ClosePanelAction
.
ID
,
ClosePanelAction
.
LABEL
)];
return
[
this
.
instantiationService
.
createInstance
(
ToggleMaximizedPanelAction
,
ToggleMaximizedPanelAction
.
ID
,
ToggleMaximizedPanelAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
ClosePanelAction
,
ClosePanelAction
.
ID
,
ClosePanelAction
.
LABEL
)
];
}
public
getActivePanel
():
IPanel
{
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
b41f1811
...
...
@@ -799,6 +799,10 @@ export class Workbench implements IPartService {
this
.
workbenchLayout
.
layout
({
toggleMaximizedPanel
:
true
});
}
public
isPanelMaximized
():
boolean
{
return
this
.
workbenchLayout
.
isPanelMaximized
();
}
public
getSideBarPosition
():
Position
{
return
this
.
sideBarPosition
;
}
...
...
src/vs/workbench/services/part/common/partService.ts
浏览文件 @
b41f1811
...
...
@@ -97,6 +97,11 @@ export interface IPartService {
*/
toggleMaximizedPanel
():
void
;
/**
* Returns true if the panel is maximized.
*/
isPanelMaximized
():
boolean
;
/**
* Gets the current side bar position. Note that the sidebar can be hidden too.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录