Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d2f01a47
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,发现更多精彩内容 >>
提交
d2f01a47
编写于
11月 13, 2019
作者:
E
Eric Amodio
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #84267 - no border when maximized/fullscreen
上级
2cd1b8b8
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
72 addition
and
24 deletion
+72
-24
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+22
-1
src/vs/workbench/browser/media/style.css
src/vs/workbench/browser/media/style.css
+1
-1
src/vs/workbench/browser/part.ts
src/vs/workbench/browser/part.ts
+1
-1
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
...vs/workbench/browser/parts/activitybar/activitybarPart.ts
+1
-1
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+1
-1
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
+3
-11
src/vs/workbench/electron-browser/window.ts
src/vs/workbench/electron-browser/window.ts
+20
-8
src/vs/workbench/services/layout/browser/layoutService.ts
src/vs/workbench/services/layout/browser/layoutService.ts
+16
-0
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+7
-0
未找到文件。
src/vs/workbench/browser/layout.ts
浏览文件 @
d2f01a47
...
...
@@ -95,6 +95,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
private
readonly
_onCenteredLayoutChange
:
Emitter
<
boolean
>
=
this
.
_register
(
new
Emitter
<
boolean
>
());
readonly
onCenteredLayoutChange
:
Event
<
boolean
>
=
this
.
_onCenteredLayoutChange
.
event
;
private
readonly
_onMaximizeChange
:
Emitter
<
boolean
>
=
this
.
_register
(
new
Emitter
<
boolean
>
());
readonly
onMaximizeChange
:
Event
<
boolean
>
=
this
.
_onMaximizeChange
.
event
;
private
readonly
_onPanelPositionChange
:
Emitter
<
string
>
=
this
.
_register
(
new
Emitter
<
string
>
());
readonly
onPanelPositionChange
:
Event
<
string
>
=
this
.
_onPanelPositionChange
.
event
;
...
...
@@ -142,6 +145,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
protected
readonly
state
=
{
fullscreen
:
false
,
maximized
:
false
,
hasFocus
:
false
,
windowBorder
:
false
,
...
...
@@ -304,6 +308,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
// Propagate to grid
this
.
workbenchGrid
.
setViewVisible
(
this
.
titleBarPartView
,
this
.
isVisible
(
Parts
.
TITLEBAR_PART
));
this
.
updateWindowBorder
(
true
);
this
.
layout
();
// handle title bar when fullscreen changes
}
...
...
@@ -399,7 +405,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
const
inactiveBorder
=
theme
.
getColor
(
WINDOW_INACTIVE_BORDER
);
let
windowBorder
=
false
;
if
(
activeBorder
||
inactiveBorder
)
{
if
(
!
this
.
state
.
fullscreen
&&
!
this
.
state
.
maximized
&&
(
activeBorder
||
inactiveBorder
)
)
{
windowBorder
=
true
;
// If one color is missing, just fallback to the other one
...
...
@@ -1250,6 +1256,21 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
this
.
_onPanelPositionChange
.
fire
(
positionToString
(
this
.
state
.
panel
.
position
));
}
isWindowMaximized
()
{
return
this
.
state
.
maximized
;
}
updateWindowMaximizedState
(
maximized
:
boolean
)
{
if
(
this
.
state
.
maximized
===
maximized
)
{
return
;
}
this
.
state
.
maximized
=
maximized
;
this
.
updateWindowBorder
();
this
.
_onMaximizeChange
.
fire
(
maximized
);
}
private
createGridDescriptor
():
ISerializedGrid
{
const
workbenchDimensions
=
this
.
getClientArea
();
const
width
=
this
.
storageService
.
getNumber
(
Storage
.
GRID_WIDTH
,
StorageScope
.
GLOBAL
,
workbenchDimensions
.
width
);
...
...
src/vs/workbench/browser/media/style.css
浏览文件 @
d2f01a47
...
...
@@ -56,7 +56,7 @@ body.web {
width
:
100vw
;
}
.monaco-workbench.border
{
.monaco-workbench.border
:not
(
.fullscreen
)
{
box-sizing
:
border-box
;
border
:
1px
solid
var
(
--window-border-color
);
}
...
...
src/vs/workbench/browser/part.ts
浏览文件 @
d2f01a47
...
...
@@ -46,7 +46,7 @@ export abstract class Part extends Component implements ISerializableView {
private
options
:
IPartOptions
,
themeService
:
IThemeService
,
storageService
:
IStorageService
,
layoutService
:
IWorkbenchLayoutService
protected
readonly
layoutService
:
IWorkbenchLayoutService
)
{
super
(
id
,
themeService
,
storageService
);
...
...
src/vs/workbench/browser/parts/activitybar/activitybarPart.ts
浏览文件 @
d2f01a47
...
...
@@ -83,7 +83,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
constructor
(
@
IViewletService
private
readonly
viewletService
:
IViewletService
,
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
,
@
IWorkbenchLayoutService
layoutService
:
IWorkbenchLayoutService
,
@
IThemeService
themeService
:
IThemeService
,
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IExtensionService
private
readonly
extensionService
:
IExtensionService
,
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
d2f01a47
...
...
@@ -139,7 +139,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IStorageService
storageService
:
IStorageService
,
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
@
IWorkbenchLayoutService
layoutService
:
IWorkbenchLayoutService
)
{
super
(
Parts
.
EDITOR_PART
,
{
hasTitle
:
false
},
themeService
,
storageService
,
layoutService
);
...
...
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
浏览文件 @
d2f01a47
...
...
@@ -45,8 +45,6 @@ import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts';
// TODO@sbatten https://github.com/microsoft/vscode/issues/81360
// tslint:disable-next-line: import-patterns layering
import
{
IElectronService
}
from
'
vs/platform/electron/node/electron
'
;
// tslint:disable-next-line: import-patterns layering
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
export
class
TitlebarPart
extends
Part
implements
ITitleService
{
...
...
@@ -107,8 +105,7 @@ export class TitlebarPart extends Part implements ITitleService {
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IHostService
private
readonly
hostService
:
IHostService
,
@
IProductService
private
readonly
productService
:
IProductService
,
@
optional
(
IElectronService
)
private
electronService
:
IElectronService
,
@
optional
(
IElectronEnvironmentService
)
private
readonly
electronEnvironmentService
:
IElectronEnvironmentService
@
optional
(
IElectronService
)
private
electronService
:
IElectronService
)
{
super
(
Parts
.
TITLEBAR_PART
,
{
hasTitle
:
false
},
themeService
,
storageService
,
layoutService
);
...
...
@@ -448,13 +445,8 @@ export class TitlebarPart extends Part implements ITitleService {
// Resizer
this
.
resizer
=
append
(
this
.
element
,
$
(
'
div.resizer
'
));
const
isMaximized
=
this
.
environmentService
.
configuration
.
maximized
?
true
:
false
;
this
.
onDidChangeMaximized
(
isMaximized
);
this
.
_register
(
Event
.
any
(
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowMaximize
,
id
=>
id
===
this
.
electronEnvironmentService
.
windowId
),
_
=>
true
),
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowUnmaximize
,
id
=>
id
===
this
.
electronEnvironmentService
.
windowId
),
_
=>
false
)
)(
e
=>
this
.
onDidChangeMaximized
(
e
)));
this
.
_register
(
this
.
layoutService
.
onMaximizeChange
(
maximized
=>
this
.
onDidChangeMaximized
(
maximized
)));
this
.
onDidChangeMaximized
(
this
.
layoutService
.
isWindowMaximized
());
}
// Since the title area is used to drag the window, we do not want to steal focus from the
...
...
src/vs/workbench/electron-browser/window.ts
浏览文件 @
d2f01a47
...
...
@@ -21,7 +21,7 @@ import * as browser from 'vs/base/browser/browser';
import
{
ICommandService
,
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
KeyboardMapperFactory
}
from
'
vs/workbench/services/keybinding/electron-browser/nativeKeymapService
'
;
import
{
ipcRenderer
as
ipc
,
webFrame
,
crashReporter
,
Event
}
from
'
electron
'
;
import
{
ipcRenderer
as
ipc
,
webFrame
,
crashReporter
,
Event
as
IpcEvent
}
from
'
electron
'
;
import
{
IWorkspaceEditingService
}
from
'
vs/workbench/services/workspaces/common/workspaceEditing
'
;
import
{
IMenuService
,
MenuId
,
IMenu
,
MenuItemAction
,
ICommandAction
,
SubmenuItemAction
,
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -62,6 +62,7 @@ import { IHostService } from 'vs/workbench/services/host/browser/host';
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
import
{
IWorkingCopyService
,
WorkingCopyCapabilities
}
from
'
vs/workbench/services/workingCopy/common/workingCopyService
'
;
import
{
AutoSaveMode
,
IFilesConfigurationService
}
from
'
vs/workbench/services/filesConfiguration/common/filesConfigurationService
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
export
class
ElectronWindow
extends
Disposable
{
...
...
@@ -126,7 +127,7 @@ export class ElectronWindow extends Disposable {
});
// Support runAction event
ipc
.
on
(
'
vscode:runAction
'
,
async
(
event
:
Event
,
request
:
IRunActionInWindowRequest
)
=>
{
ipc
.
on
(
'
vscode:runAction
'
,
async
(
event
:
Ipc
Event
,
request
:
IRunActionInWindowRequest
)
=>
{
const
args
:
unknown
[]
=
request
.
args
||
[];
// If we run an action from the touchbar, we fill in the currently active resource
...
...
@@ -157,27 +158,27 @@ export class ElectronWindow extends Disposable {
});
// Support runKeybinding event
ipc
.
on
(
'
vscode:runKeybinding
'
,
(
event
:
Event
,
request
:
IRunKeybindingInWindowRequest
)
=>
{
ipc
.
on
(
'
vscode:runKeybinding
'
,
(
event
:
Ipc
Event
,
request
:
IRunKeybindingInWindowRequest
)
=>
{
if
(
document
.
activeElement
)
{
this
.
keybindingService
.
dispatchByUserSettingsLabel
(
request
.
userSettingsLabel
,
document
.
activeElement
);
}
});
// Error reporting from main
ipc
.
on
(
'
vscode:reportError
'
,
(
event
:
Event
,
error
:
string
)
=>
{
ipc
.
on
(
'
vscode:reportError
'
,
(
event
:
Ipc
Event
,
error
:
string
)
=>
{
if
(
error
)
{
errors
.
onUnexpectedError
(
JSON
.
parse
(
error
));
}
});
// Support openFiles event for existing and new files
ipc
.
on
(
'
vscode:openFiles
'
,
(
event
:
Event
,
request
:
IOpenFileRequest
)
=>
this
.
onOpenFiles
(
request
));
ipc
.
on
(
'
vscode:openFiles
'
,
(
event
:
Ipc
Event
,
request
:
IOpenFileRequest
)
=>
this
.
onOpenFiles
(
request
));
// Support addFolders event if we have a workspace opened
ipc
.
on
(
'
vscode:addFolders
'
,
(
event
:
Event
,
request
:
IAddFoldersRequest
)
=>
this
.
onAddFoldersRequest
(
request
));
ipc
.
on
(
'
vscode:addFolders
'
,
(
event
:
Ipc
Event
,
request
:
IAddFoldersRequest
)
=>
this
.
onAddFoldersRequest
(
request
));
// Message support
ipc
.
on
(
'
vscode:showInfoMessage
'
,
(
event
:
Event
,
message
:
string
)
=>
{
ipc
.
on
(
'
vscode:showInfoMessage
'
,
(
event
:
Ipc
Event
,
message
:
string
)
=>
{
this
.
notificationService
.
info
(
message
);
});
...
...
@@ -215,7 +216,7 @@ export class ElectronWindow extends Disposable {
});
// keyboard layout changed event
ipc
.
on
(
'
vscode:accessibilitySupportChanged
'
,
(
event
:
Event
,
accessibilitySupportEnabled
:
boolean
)
=>
{
ipc
.
on
(
'
vscode:accessibilitySupportChanged
'
,
(
event
:
Ipc
Event
,
accessibilitySupportEnabled
:
boolean
)
=>
{
this
.
accessibilityService
.
setAccessibilitySupport
(
accessibilitySupportEnabled
?
AccessibilitySupport
.
Enabled
:
AccessibilitySupport
.
Disabled
);
});
...
...
@@ -281,6 +282,17 @@ export class ElectronWindow extends Disposable {
}
}));
}
this
.
_register
(
Event
.
any
(
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowMaximize
,
id
=>
id
===
this
.
electronEnvironmentService
.
windowId
),
()
=>
true
),
Event
.
map
(
Event
.
filter
(
this
.
electronService
.
onWindowUnmaximize
,
id
=>
id
===
this
.
electronEnvironmentService
.
windowId
),
()
=>
false
)
)(
e
=>
this
.
onDidChangeMaximized
(
e
)));
this
.
onDidChangeMaximized
(
this
.
environmentService
.
configuration
.
maximized
??
false
);
}
private
onDidChangeMaximized
(
maximized
:
boolean
):
void
{
this
.
layoutService
.
updateWindowMaximizedState
(
maximized
);
}
private
onDidVisibleEditorsChange
():
void
{
...
...
src/vs/workbench/services/layout/browser/layoutService.ts
浏览文件 @
d2f01a47
...
...
@@ -41,6 +41,11 @@ export interface IWorkbenchLayoutService extends ILayoutService {
*/
readonly
onFullscreenChange
:
Event
<
boolean
>
;
/**
* Emits when the window is maximized or unmaximized.
*/
readonly
onMaximizeChange
:
Event
<
boolean
>
;
/**
* Emits when centered layout is enabled or disabled.
*/
...
...
@@ -188,4 +193,15 @@ export interface IWorkbenchLayoutService extends ILayoutService {
* Register a part to participate in the layout.
*/
registerPart
(
part
:
Part
):
void
;
/**
* Returns whether the window is maximized.
*/
isWindowMaximized
():
boolean
;
/**
* Updates the maximized state of the window.
*/
updateWindowMaximizedState
(
maximized
:
boolean
):
void
;
}
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
d2f01a47
...
...
@@ -463,6 +463,7 @@ export class TestLayoutService implements IWorkbenchLayoutService {
onZenModeChange
:
Event
<
boolean
>
=
Event
.
None
;
onCenteredLayoutChange
:
Event
<
boolean
>
=
Event
.
None
;
onFullscreenChange
:
Event
<
boolean
>
=
Event
.
None
;
onMaximizeChange
:
Event
<
boolean
>
=
Event
.
None
;
onPanelPositionChange
:
Event
<
string
>
=
Event
.
None
;
onPartVisibilityChange
:
Event
<
void
>
=
Event
.
None
;
onLayout
=
Event
.
None
;
...
...
@@ -572,6 +573,12 @@ export class TestLayoutService implements IWorkbenchLayoutService {
public
resizePart
(
_part
:
Parts
,
_sizeChange
:
number
):
void
{
}
public
registerPart
(
part
:
Part
):
void
{
}
isWindowMaximized
()
{
return
false
;
}
public
updateWindowMaximizedState
(
maximized
:
boolean
):
void
{
}
}
let
activeViewlet
:
Viewlet
=
{}
as
any
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录