Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8ffed7ef
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,发现更多精彩内容 >>
提交
8ffed7ef
编写于
11月 08, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
title - fix quick open positioning
上级
152cccfe
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
67 addition
and
9 deletion
+67
-9
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
+4
-0
src/vs/test/utils/servicesTestUtils.ts
src/vs/test/utils/servicesTestUtils.ts
+10
-0
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
.../workbench/browser/parts/quickopen/quickOpenController.ts
+18
-1
src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css
...s/workbench/browser/parts/titlebar/media/titlebarpart.css
+0
-8
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+20
-0
src/vs/workbench/services/message/browser/messageList.ts
src/vs/workbench/services/message/browser/messageList.ts
+4
-0
src/vs/workbench/services/part/common/partService.ts
src/vs/workbench/services/part/common/partService.ts
+11
-0
未找到文件。
src/vs/base/parts/quickopen/browser/quickOpenWidget.ts
浏览文件 @
8ffed7ef
...
...
@@ -108,6 +108,10 @@ export class QuickOpenWidget implements IModelProvider {
this
.
model
=
null
;
}
public
getElement
():
Builder
{
return
$
(
this
.
builder
);
}
public
getModel
():
IModel
<
any
>
{
return
this
.
model
;
}
...
...
src/vs/test/utils/servicesTestUtils.ts
浏览文件 @
8ffed7ef
...
...
@@ -217,6 +217,12 @@ export class TestMessageService implements IMessageService {
export
class
TestPartService
implements
IPartService
{
public
_serviceBrand
:
any
;
private
_onTitleBarVisibilityChange
=
new
Emitter
<
void
>
();
public
get
onTitleBarVisibilityChange
():
Event
<
void
>
{
return
this
.
_onTitleBarVisibilityChange
.
event
;
}
public
layout
():
void
{
}
public
isCreated
():
boolean
{
...
...
@@ -243,6 +249,10 @@ export class TestPartService implements IPartService {
return
false
;
}
public
getTitleBarOffset
():
number
{
return
0
;
}
public
isStatusBarHidden
():
boolean
{
return
false
;
}
...
...
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
浏览文件 @
8ffed7ef
...
...
@@ -8,6 +8,7 @@
import
'
vs/css!./media/quickopen
'
;
import
{
TPromise
,
ValueCallback
}
from
'
vs/base/common/winjs.base
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
{
Dimension
,
withElementById
}
from
'
vs/base/browser/builder
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
filters
=
require
(
'
vs/base/common/filters
'
);
...
...
@@ -126,7 +127,9 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
}
private
registerListeners
():
void
{
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
this
.
updateConfiguration
(
e
.
config
));
this
.
toUnbind
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
this
.
updateConfiguration
(
e
.
config
)));
this
.
toUnbind
.
push
(
this
.
partService
.
onTitleBarVisibilityChange
(()
=>
this
.
positionQuickOpenWidget
()));
this
.
toUnbind
.
push
(
browser
.
onDidChangeZoomLevel
(()
=>
this
.
positionQuickOpenWidget
()));
}
private
updateConfiguration
(
settings
:
IWorkbenchQuickOpenConfiguration
):
void
{
...
...
@@ -279,6 +282,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
const
pickOpenContainer
=
this
.
pickOpenWidget
.
create
();
DOM
.
addClass
(
pickOpenContainer
,
'
show-file-icons
'
);
this
.
positionQuickOpenWidget
();
}
// Update otherwise
...
...
@@ -512,6 +516,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
const
quickOpenContainer
=
this
.
quickOpenWidget
.
create
();
DOM
.
addClass
(
quickOpenContainer
,
'
show-file-icons
'
);
this
.
positionQuickOpenWidget
();
}
// Layout
...
...
@@ -549,6 +554,18 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
return
promiseCompletedOnHide
;
}
private
positionQuickOpenWidget
():
void
{
let
titlebarOffset
=
this
.
partService
.
getTitleBarOffset
();
if
(
this
.
quickOpenWidget
)
{
this
.
quickOpenWidget
.
getElement
().
style
(
'
top
'
,
`
${
titlebarOffset
}
px`
);
}
if
(
this
.
pickOpenWidget
)
{
this
.
pickOpenWidget
.
getElement
().
style
(
'
top
'
,
`
${
titlebarOffset
}
px`
);
}
}
private
handleOnShow
(
isPicker
:
boolean
):
void
{
if
(
isPicker
&&
this
.
quickOpenWidget
)
{
this
.
quickOpenWidget
.
hide
(
HideReason
.
FOCUS_LOST
);
...
...
src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css
浏览文件 @
8ffed7ef
...
...
@@ -31,14 +31,6 @@
zoom
:
1
;
/* prevent zooming */
}
.titlebar-style-custom
.monaco-workbench.fullscreen
.quick-open-widget
{
top
:
0
;
}
.titlebar-style-custom
.monaco-workbench
.quick-open-widget
{
top
:
22px
;
/* push down quick open when we have a custom title bar */
}
/* Theming */
.vs
.monaco-workbench
>
.part.titlebar
{
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
8ffed7ef
...
...
@@ -10,6 +10,7 @@ import 'vs/css!./media/workbench';
import
{
TPromise
,
ValueCallback
}
from
'
vs/base/common/winjs.base
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
{
Delayer
}
from
'
vs/base/common/async
'
;
...
...
@@ -120,6 +121,8 @@ export class Workbench implements IPartService {
private
static
sidebarPositionConfigurationKey
=
'
workbench.sideBar.location
'
;
private
static
statusbarVisibleConfigurationKey
=
'
workbench.statusBar.visible
'
;
private
_onTitleBarVisibilityChange
:
Emitter
<
void
>
;
public
_serviceBrand
:
any
;
private
parent
:
HTMLElement
;
...
...
@@ -187,11 +190,17 @@ export class Workbench implements IPartService {
this
.
toShutdown
=
[];
this
.
editorBackgroundDelayer
=
new
Delayer
<
void
>
(
50
);
this
.
_onTitleBarVisibilityChange
=
new
Emitter
<
void
>
();
this
.
creationPromise
=
new
TPromise
<
boolean
>
(
c
=>
{
this
.
creationPromiseComplete
=
c
;
});
}
public
get
onTitleBarVisibilityChange
():
Event
<
void
>
{
return
this
.
_onTitleBarVisibilityChange
.
event
;
}
/**
* Starts the workbench and creates the HTML elements on the container. A workbench can only be started
* once. Use the shutdown function to free up resources created by the workbench on startup.
...
...
@@ -546,6 +555,15 @@ export class Workbench implements IPartService {
return
!
this
.
getCustomTitleBarStyle
()
||
browser
.
isFullscreen
();
}
public
getTitleBarOffset
():
number
{
let
offset
=
0
;
if
(
!
this
.
isTitleBarHidden
())
{
offset
=
22
/
browser
.
getZoomFactor
();
// adjust the position based on title bar size and zoom factor
}
return
offset
;
}
private
getCustomTitleBarStyle
():
string
{
if
(
!
isMacintosh
)
{
return
null
;
// custom title bar is only supported on Mac currently
...
...
@@ -752,12 +770,14 @@ export class Workbench implements IPartService {
this
.
addClass
(
'
fullscreen
'
);
if
(
hasCustomTitle
)
{
this
.
_onTitleBarVisibilityChange
.
fire
();
this
.
layout
({
forceStyleRecompute
:
true
});
// handle title bar when fullscreen changes
}
}
else
{
this
.
removeClass
(
'
fullscreen
'
);
if
(
hasCustomTitle
)
{
this
.
_onTitleBarVisibilityChange
.
fire
();
this
.
layout
({
forceStyleRecompute
:
true
});
// handle title bar when fullscreen changes
}
}
...
...
src/vs/workbench/services/message/browser/messageList.ts
浏览文件 @
8ffed7ef
...
...
@@ -211,6 +211,10 @@ export class MessageList {
}
private
positionMessageList
(
animate
?:
boolean
):
void
{
if
(
!
this
.
messageListContainer
)
{
return
;
// not yet created
}
$
(
this
.
messageListContainer
).
removeClass
(
'
transition
'
);
// disable any animations
let
position
=
0
;
...
...
src/vs/workbench/services/part/common/partService.ts
浏览文件 @
8ffed7ef
...
...
@@ -6,6 +6,7 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
createDecorator
,
ServiceIdentifier
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
Event
from
'
vs/base/common/event
'
;
export
enum
Parts
{
ACTIVITYBAR_PART
,
...
...
@@ -31,6 +32,11 @@ export const IPartService = createDecorator<IPartService>('partService');
export
interface
IPartService
{
_serviceBrand
:
ServiceIdentifier
<
any
>
;
/**
* Emits when the visibility of the title bar changes.
*/
onTitleBarVisibilityChange
:
Event
<
void
>
;
/**
* Asks the part service to layout all parts.
*/
...
...
@@ -66,6 +72,11 @@ export interface IPartService {
*/
isTitleBarHidden
():
boolean
;
/**
* Number of pixels (adjusted for zooming) that the title bar (if visible) pushes down the workbench contents.
*/
getTitleBarOffset
():
number
;
/**
* Checks if the statusbar is currently hidden or not
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录