Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
222ede8b
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,发现更多精彩内容 >>
提交
222ede8b
编写于
11月 08, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
title - first cut of no more css madness
上级
aff2353a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
70 addition
and
40 deletion
+70
-40
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+20
-13
src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css
...s/workbench/browser/parts/titlebar/media/titlebarpart.css
+1
-10
src/vs/workbench/electron-browser/integration.ts
src/vs/workbench/electron-browser/integration.ts
+0
-10
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+48
-6
src/vs/workbench/services/part/common/partService.ts
src/vs/workbench/services/part/common/partService.ts
+1
-1
未找到文件。
src/vs/workbench/browser/layout.ts
浏览文件 @
222ede8b
...
...
@@ -9,7 +9,7 @@ import { Part } from 'vs/workbench/browser/part';
import
{
QuickOpenController
}
from
'
vs/workbench/browser/parts/quickopen/quickOpenController
'
;
import
{
Sash
,
ISashEvent
,
IVerticalSashLayoutProvider
,
IHorizontalSashLayoutProvider
,
Orientation
}
from
'
vs/base/browser/ui/sash/sash
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IPartService
,
Position
,
ILayoutOptions
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IPartService
,
Position
,
ILayoutOptions
,
Parts
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/common/viewletService
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
...
...
@@ -29,7 +29,7 @@ const HIDE_SIDEBAR_WIDTH_THRESHOLD = 50;
const
HIDE_PANEL_HEIGHT_THRESHOLD
=
50
;
interface
ComputedStyles
{
titlebar
:
{
height
:
number
;
display
:
string
;
};
titlebar
:
{
height
:
number
;
};
activitybar
:
{
width
:
number
;
};
sidebar
:
{
minWidth
:
number
;
};
panel
:
{
minHeight
:
number
;
};
...
...
@@ -295,8 +295,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
// Determine styles by looking into their CSS
this
.
computedStyles
=
{
titlebar
:
{
height
:
parseInt
(
titlebarStyle
.
getPropertyValue
(
'
height
'
),
10
),
display
:
titlebarStyle
.
getPropertyValue
(
'
display
'
)
height
:
parseInt
(
titlebarStyle
.
getPropertyValue
(
'
height
'
),
10
)
},
activitybar
:
{
width
:
parseInt
(
activitybarStyle
.
getPropertyValue
(
'
width
'
),
10
)
...
...
@@ -336,10 +335,11 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this
.
workbenchSize
=
this
.
getWorkbenchArea
();
const
isSidebarHidden
=
this
.
partService
.
isSideBarHidden
();
const
isPanelHidden
=
this
.
partService
.
isPanelHidden
();
const
isTitlebarHidden
=
!
this
.
partService
.
isVisible
(
Parts
.
TITLEBAR_PART
);
const
isPanelHidden
=
!
this
.
partService
.
isVisible
(
Parts
.
PANEL_PART
);
const
isStatusbarHidden
=
!
this
.
partService
.
isVisible
(
Parts
.
STATUSBAR_PART
);
const
isSidebarHidden
=
!
this
.
partService
.
isVisible
(
Parts
.
SIDEBAR_PART
);
const
sidebarPosition
=
this
.
partService
.
getSideBarPosition
();
const
isStatusbarHidden
=
this
.
partService
.
isStatusBarHidden
();
// Sidebar
let
sidebarWidth
:
number
;
...
...
@@ -353,12 +353,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
}
this
.
statusbarHeight
=
isStatusbarHidden
?
0
:
this
.
computedStyles
.
statusbar
.
height
;
if
(
this
.
computedStyles
.
titlebar
.
display
===
'
none
'
)
{
this
.
titlebarHeight
=
0
;
// custom title bar is hidden
}
else
{
this
.
titlebarHeight
=
this
.
initialComputedStyles
.
titlebar
.
height
/
getZoomFactor
();
// adjust for zoom prevention
}
this
.
titlebarHeight
=
isTitlebarHidden
?
0
:
this
.
initialComputedStyles
.
titlebar
.
height
/
getZoomFactor
();
// adjust for zoom prevention
this
.
sidebarHeight
=
this
.
workbenchSize
.
height
-
this
.
statusbarHeight
-
this
.
titlebarHeight
;
let
sidebarSize
=
new
Dimension
(
sidebarWidth
,
this
.
sidebarHeight
);
...
...
@@ -460,6 +455,13 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
workbenchContainer
.
scrollLeft
=
0
;
}
// Title Part
if
(
isTitlebarHidden
)
{
this
.
titlebar
.
getContainer
().
hide
();
}
else
{
this
.
titlebar
.
getContainer
().
show
();
}
// Editor Part and Panel part
this
.
editor
.
getContainer
().
size
(
editorSize
.
width
,
editorSize
.
height
);
this
.
panel
.
getContainer
().
size
(
panelDimension
.
width
,
panelDimension
.
height
);
...
...
@@ -497,6 +499,11 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
// Statusbar Part
this
.
statusbar
.
getContainer
().
position
(
this
.
workbenchSize
.
height
-
this
.
statusbarHeight
);
if
(
isStatusbarHidden
)
{
this
.
statusbar
.
getContainer
().
hide
();
}
else
{
this
.
statusbar
.
getContainer
().
show
();
}
// Quick open
this
.
quickopen
.
layout
(
this
.
workbenchSize
);
...
...
src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css
浏览文件 @
222ede8b
...
...
@@ -16,17 +16,8 @@
-webkit-user-select
:
none
;
-webkit-app-region
:
drag
;
zoom
:
1
;
/* prevent zooming */
}
.monaco-workbench
>
.part.titlebar
,
.titlebar-style-custom
.monaco-workbench.fullscreen
>
.part.titlebar
{
height
:
0
;
/* needs extra class to be enabled (also disabled in fullscreen mode) */
display
:
none
;
}
.titlebar-style-custom
.monaco-workbench
>
.part.titlebar
{
height
:
22px
;
line-height
:
22px
;
height
:
22px
;
display
:
flex
;
}
...
...
src/vs/workbench/electron-browser/integration.ts
浏览文件 @
222ede8b
...
...
@@ -141,22 +141,12 @@ export class ElectronIntegration {
ipc
.
on
(
'
vscode:enterFullScreen
'
,
(
event
)
=>
{
this
.
partService
.
joinCreation
().
then
(()
=>
{
browser
.
setFullscreen
(
true
);
this
.
partService
.
addClass
(
'
fullscreen
'
);
if
(
!
this
.
partService
.
isTitleBarHidden
())
{
this
.
partService
.
layout
({
forceStyleRecompute
:
true
});
// handle title bar when fullscreen changes
}
});
});
ipc
.
on
(
'
vscode:leaveFullScreen
'
,
(
event
)
=>
{
this
.
partService
.
joinCreation
().
then
(()
=>
{
browser
.
setFullscreen
(
false
);
this
.
partService
.
removeClass
(
'
fullscreen
'
);
if
(
!
this
.
partService
.
isTitleBarHidden
())
{
this
.
partService
.
layout
({
forceStyleRecompute
:
true
});
// handle title bar when fullscreen changes
}
});
});
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
222ede8b
...
...
@@ -13,6 +13,7 @@ import strings = require('vs/base/common/strings');
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
{
Delayer
}
from
'
vs/base/common/async
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
assert
=
require
(
'
vs/base/common/assert
'
);
import
timer
=
require
(
'
vs/base/common/timer
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
...
...
@@ -529,7 +530,7 @@ export class Workbench implements IPartService {
public
isVisible
(
part
:
Parts
):
boolean
{
switch
(
part
)
{
case
Parts
.
TITLEBAR_PART
:
return
this
.
isTitleBarHidden
();
return
!
this
.
isTitleBarHidden
();
case
Parts
.
SIDEBAR_PART
:
return
!
this
.
sideBarHidden
;
case
Parts
.
PANEL_PART
:
...
...
@@ -542,18 +543,28 @@ export class Workbench implements IPartService {
}
public
isTitleBarHidden
():
boolean
{
return
!
this
.
getCustomTitleBarStyle
()
||
browser
.
isFullscreen
();
}
private
getCustomTitleBarStyle
():
string
{
if
(
!
isMacintosh
)
{
return
true
;
// custom title bar is only supported on Mac currently
return
null
;
// custom title bar is only supported on Mac currently
}
const
isDev
=
!
this
.
environmentService
.
isBuilt
||
this
.
environmentService
.
extensionDevelopmentPath
;
if
(
isDev
)
{
return
true
;
// not enabled when developing due to https://github.com/electron/electron/issues/3647
return
null
;
// not enabled when developing due to https://github.com/electron/electron/issues/3647
}
const
windowConfig
=
this
.
configurationService
.
getConfiguration
<
IWindowConfiguration
>
();
return
(
windowConfig
&&
windowConfig
.
window
&&
windowConfig
.
window
.
titleBarStyle
===
'
native
'
);
const
style
=
windowConfig
&&
windowConfig
.
window
&&
windowConfig
.
window
.
titleBarStyle
;
if
(
style
===
'
custom
'
)
{
return
style
;
}
return
null
;
}
public
isStatusBarHidden
():
boolean
{
...
...
@@ -725,6 +736,31 @@ export class Workbench implements IPartService {
// Configuration changes
this
.
toDispose
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(()
=>
this
.
onDidUpdateConfiguration
()));
// Fullscreen changes
this
.
toDispose
.
push
(
browser
.
onDidChangeFullscreen
(()
=>
this
.
onFullscreenChanged
()));
}
private
onFullscreenChanged
():
void
{
if
(
!
this
.
isCreated
)
{
return
;
// we need to be ready
}
const
isFullscreen
=
browser
.
isFullscreen
();
const
hasCustomTitle
=
!!
this
.
getCustomTitleBarStyle
();
if
(
isFullscreen
)
{
this
.
addClass
(
'
fullscreen
'
);
if
(
hasCustomTitle
)
{
this
.
layout
({
forceStyleRecompute
:
true
});
// handle title bar when fullscreen changes
}
}
else
{
this
.
removeClass
(
'
fullscreen
'
);
if
(
hasCustomTitle
)
{
this
.
layout
({
forceStyleRecompute
:
true
});
// handle title bar when fullscreen changes
}
}
}
private
onEditorsChanged
():
void
{
...
...
@@ -797,8 +833,14 @@ export class Workbench implements IPartService {
}
// Apply title style if shown
if
(
!
this
.
isTitleBarHidden
())
{
DOM
.
addClass
(
this
.
parent
,
'
titlebar-style-custom
'
);
const
titleStyle
=
this
.
getCustomTitleBarStyle
();
if
(
titleStyle
)
{
DOM
.
addClass
(
this
.
parent
,
`titlebar-style-
${
titleStyle
}
`
);
}
// Apply fullscreen state
if
(
browser
.
isFullscreen
())
{
this
.
workbench
.
addClass
(
'
fullscreen
'
);
}
// Create Parts
...
...
src/vs/workbench/services/part/common/partService.ts
浏览文件 @
222ede8b
...
...
@@ -62,7 +62,7 @@ export interface IPartService {
isVisible
(
part
:
Parts
):
boolean
;
/**
* Returns iff the
titlebar part is currently hidden or not
.
* Returns iff the
custom titlebar part is visible
.
*/
isTitleBarHidden
():
boolean
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录