Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
43298ba5
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,发现更多精彩内容 >>
提交
43298ba5
编写于
5月 29, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
macOS: custom titlebar double-click not consistent (fixes #27382)
上级
e4080aa0
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
57 addition
and
7 deletion
+57
-7
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+27
-0
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+2
-0
src/vs/platform/windows/common/windowsIpc.ts
src/vs/platform/windows/common/windowsIpc.ts
+6
-0
src/vs/platform/windows/electron-browser/windowService.ts
src/vs/platform/windows/electron-browser/windowService.ts
+4
-0
src/vs/platform/windows/electron-main/windowsService.ts
src/vs/platform/windows/electron-main/windowsService.ts
+10
-0
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
+1
-7
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+7
-0
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
43298ba5
...
...
@@ -823,6 +823,33 @@ export class VSCodeWindow {
};
}
public
onWindowTitleDoubleClick
():
void
{
// Respect system settings on mac with regards to title click on windows title
if
(
platform
.
isMacintosh
)
{
const
action
=
systemPreferences
.
getUserDefault
(
'
AppleActionOnDoubleClick
'
,
'
string
'
);
switch
(
action
)
{
case
'
Minimize
'
:
this
.
win
.
minimize
();
break
;
case
'
None
'
:
break
;
case
'
Maximize
'
:
default
:
this
.
win
.
maximize
();
}
}
// Linux/Windows: just toggle maximize/minimized state
else
{
if
(
this
.
win
.
isMaximized
())
{
this
.
win
.
unmaximize
();
}
else
{
this
.
win
.
maximize
();
}
}
}
public
sendWhenReady
(
channel
:
string
,
...
args
:
any
[]):
void
{
this
.
ready
().
then
(()
=>
{
this
.
send
(
channel
,
...
args
);
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
43298ba5
...
...
@@ -37,6 +37,7 @@ export interface IWindowsService {
isMaximized
(
windowId
:
number
):
TPromise
<
boolean
>
;
maximizeWindow
(
windowId
:
number
):
TPromise
<
void
>
;
unmaximizeWindow
(
windowId
:
number
):
TPromise
<
void
>
;
onWindowTitleDoubleClick
(
windowId
:
number
):
TPromise
<
void
>
;
setDocumentEdited
(
windowId
:
number
,
flag
:
boolean
):
TPromise
<
void
>
;
quit
():
TPromise
<
void
>
;
relaunch
(
options
:
{
addArgs
?:
string
[],
removeArgs
?:
string
[]
}):
TPromise
<
void
>
;
...
...
@@ -89,6 +90,7 @@ export interface IWindowService {
isMaximized
():
TPromise
<
boolean
>
;
maximizeWindow
():
TPromise
<
void
>
;
unmaximizeWindow
():
TPromise
<
void
>
;
onWindowTitleDoubleClick
():
TPromise
<
void
>
;
}
export
type
MenuBarVisibility
=
'
default
'
|
'
visible
'
|
'
toggle
'
|
'
hidden
'
;
...
...
src/vs/platform/windows/common/windowsIpc.ts
浏览文件 @
43298ba5
...
...
@@ -31,6 +31,7 @@ export interface IWindowsChannel extends IChannel {
call
(
command
:
'
isMaximized
'
,
arg
:
number
):
TPromise
<
boolean
>
;
call
(
command
:
'
maximizeWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
unmaximizeWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
onWindowTitleDoubleClick
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
setDocumentEdited
'
,
arg
:
[
number
,
boolean
]):
TPromise
<
void
>
;
call
(
command
:
'
quit
'
):
TPromise
<
void
>
;
call
(
command
:
'
openWindow
'
,
arg
:
[
string
[],
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
}]):
TPromise
<
void
>
;
...
...
@@ -81,6 +82,7 @@ export class WindowsChannel implements IWindowsChannel {
case
'
isMaximized
'
:
return
this
.
service
.
isMaximized
(
arg
);
case
'
maximizeWindow
'
:
return
this
.
service
.
maximizeWindow
(
arg
);
case
'
unmaximizeWindow
'
:
return
this
.
service
.
unmaximizeWindow
(
arg
);
case
'
onWindowTitleDoubleClick
'
:
return
this
.
service
.
onWindowTitleDoubleClick
(
arg
);
case
'
setDocumentEdited
'
:
return
this
.
service
.
setDocumentEdited
(
arg
[
0
],
arg
[
1
]);
case
'
openWindow
'
:
return
this
.
service
.
openWindow
(
arg
[
0
],
arg
[
1
]);
case
'
openNewWindow
'
:
return
this
.
service
.
openNewWindow
();
...
...
@@ -185,6 +187,10 @@ export class WindowsChannelClient implements IWindowsService {
return
this
.
channel
.
call
(
'
unmaximizeWindow
'
,
windowId
);
}
onWindowTitleDoubleClick
(
windowId
:
number
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
onWindowTitleDoubleClick
'
,
windowId
);
}
setDocumentEdited
(
windowId
:
number
,
flag
:
boolean
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
setDocumentEdited
'
,
[
windowId
,
flag
]);
}
...
...
src/vs/platform/windows/electron-browser/windowService.ts
浏览文件 @
43298ba5
...
...
@@ -90,6 +90,10 @@ export class WindowService implements IWindowService {
return
this
.
windowsService
.
unmaximizeWindow
(
this
.
windowId
);
}
onWindowTitleDoubleClick
():
TPromise
<
void
>
{
return
this
.
windowsService
.
onWindowTitleDoubleClick
(
this
.
windowId
);
}
setDocumentEdited
(
flag
:
boolean
):
TPromise
<
void
>
{
return
this
.
windowsService
.
setDocumentEdited
(
this
.
windowId
,
flag
);
}
...
...
src/vs/platform/windows/electron-main/windowsService.ts
浏览文件 @
43298ba5
...
...
@@ -209,6 +209,16 @@ export class WindowsService implements IWindowsService, IDisposable {
return
TPromise
.
as
(
null
);
}
onWindowTitleDoubleClick
(
windowId
:
number
):
TPromise
<
void
>
{
const
vscodeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
if
(
vscodeWindow
)
{
vscodeWindow
.
onWindowTitleDoubleClick
();
}
return
TPromise
.
as
(
null
);
}
setDocumentEdited
(
windowId
:
number
,
flag
:
boolean
):
TPromise
<
void
>
{
const
vscodeWindow
=
this
.
windowsMainService
.
getWindowById
(
windowId
);
...
...
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
浏览文件 @
43298ba5
...
...
@@ -241,13 +241,7 @@ export class TitlebarPart extends Part implements ITitleService {
}
private
onTitleDoubleclick
():
void
{
this
.
windowService
.
isMaximized
().
then
(
maximized
=>
{
if
(
maximized
)
{
this
.
windowService
.
unmaximizeWindow
().
done
(
null
,
errors
.
onUnexpectedError
);
}
else
{
this
.
windowService
.
maximizeWindow
().
done
(
null
,
errors
.
onUnexpectedError
);
}
},
errors
.
onUnexpectedError
);
this
.
windowService
.
onWindowTitleDoubleClick
().
then
(
null
,
errors
.
onUnexpectedError
);
}
private
onContextMenu
(
e
:
MouseEvent
):
void
{
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
43298ba5
...
...
@@ -847,6 +847,10 @@ export class TestWindowService implements IWindowService {
unmaximizeWindow
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
onWindowTitleDoubleClick
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
}
export
class
TestLifecycleService
implements
ILifecycleService
{
...
...
@@ -944,6 +948,9 @@ export class TestWindowsService implements IWindowsService {
unmaximizeWindow
(
windowId
:
number
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
onWindowTitleDoubleClick
(
windowId
:
number
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
setDocumentEdited
(
windowId
:
number
,
flag
:
boolean
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录