Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0c8a0750
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,发现更多精彩内容 >>
提交
0c8a0750
编写于
8月 09, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
touchbar - allow to disable/enable without restart
上级
5d8c2877
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
31 deletion
+24
-31
src/vs/workbench/contrib/relauncher/common/relauncher.contribution.ts
...ench/contrib/relauncher/common/relauncher.contribution.ts
+0
-8
src/vs/workbench/electron-browser/window.ts
src/vs/workbench/electron-browser/window.ts
+24
-23
未找到文件。
src/vs/workbench/contrib/relauncher/common/relauncher.contribution.ts
浏览文件 @
0c8a0750
...
@@ -23,7 +23,6 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
...
@@ -23,7 +23,6 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
interface
IConfiguration
extends
IWindowsConfiguration
{
interface
IConfiguration
extends
IWindowsConfiguration
{
update
:
{
mode
:
string
;
};
update
:
{
mode
:
string
;
};
telemetry
:
{
enableCrashReporter
:
boolean
};
telemetry
:
{
enableCrashReporter
:
boolean
};
keyboard
:
{
touchbar
:
{
enabled
:
boolean
}
};
workbench
:
{
list
:
{
horizontalScrolling
:
boolean
},
useExperimentalGridLayout
:
boolean
};
workbench
:
{
list
:
{
horizontalScrolling
:
boolean
},
useExperimentalGridLayout
:
boolean
};
debug
:
{
console
:
{
wordWrap
:
boolean
}
};
debug
:
{
console
:
{
wordWrap
:
boolean
}
};
}
}
...
@@ -36,7 +35,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
...
@@ -36,7 +35,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
private
clickThroughInactive
:
boolean
;
private
clickThroughInactive
:
boolean
;
private
updateMode
:
string
;
private
updateMode
:
string
;
private
enableCrashReporter
:
boolean
;
private
enableCrashReporter
:
boolean
;
private
touchbarEnabled
:
boolean
;
private
treeHorizontalScrolling
:
boolean
;
private
treeHorizontalScrolling
:
boolean
;
private
useGridLayout
:
boolean
;
private
useGridLayout
:
boolean
;
private
debugConsoleWordWrap
:
boolean
;
private
debugConsoleWordWrap
:
boolean
;
...
@@ -112,12 +110,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
...
@@ -112,12 +110,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
this
.
enableCrashReporter
=
config
.
telemetry
.
enableCrashReporter
;
this
.
enableCrashReporter
=
config
.
telemetry
.
enableCrashReporter
;
changed
=
true
;
changed
=
true
;
}
}
// macOS: Touchbar config
if
(
isMacintosh
&&
config
.
keyboard
&&
config
.
keyboard
.
touchbar
&&
typeof
config
.
keyboard
.
touchbar
.
enabled
===
'
boolean
'
&&
config
.
keyboard
.
touchbar
.
enabled
!==
this
.
touchbarEnabled
)
{
this
.
touchbarEnabled
=
config
.
keyboard
.
touchbar
.
enabled
;
changed
=
true
;
}
}
}
// Notify only when changed and we are the focused window (avoids notification spam across windows)
// Notify only when changed and we are the focused window (avoids notification spam across windows)
...
...
src/vs/workbench/electron-browser/window.ts
浏览文件 @
0c8a0750
...
@@ -213,7 +213,7 @@ export class ElectronWindow extends Disposable {
...
@@ -213,7 +213,7 @@ export class ElectronWindow extends Disposable {
this
.
_register
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
{
this
.
_register
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
'
window.zoomLevel
'
))
{
if
(
e
.
affectsConfiguration
(
'
window.zoomLevel
'
))
{
this
.
updateWindowZoomLevel
();
this
.
updateWindowZoomLevel
();
}
else
if
(
e
.
affectsConfiguration
(
'
keyboard.touchbar.ignored
'
))
{
}
else
if
(
e
.
affectsConfiguration
(
'
keyboard.touchbar.
enabled
'
)
||
e
.
affectsConfiguration
(
'
keyboard.touchbar.
ignored
'
))
{
this
.
updateTouchbarMenu
();
this
.
updateTouchbarMenu
();
}
}
}));
}));
...
@@ -342,11 +342,8 @@ export class ElectronWindow extends Disposable {
...
@@ -342,11 +342,8 @@ export class ElectronWindow extends Disposable {
}
}
private
updateTouchbarMenu
():
void
{
private
updateTouchbarMenu
():
void
{
if
(
if
(
!
isMacintosh
)
{
!
isMacintosh
||
// macOS only
return
;
// macOS only
!
this
.
configurationService
.
getValue
<
boolean
>
(
'
keyboard.touchbar.enabled
'
)
// disabled via setting
)
{
return
;
}
}
// Dispose old
// Dispose old
...
@@ -368,36 +365,40 @@ export class ElectronWindow extends Disposable {
...
@@ -368,36 +365,40 @@ export class ElectronWindow extends Disposable {
const
actions
:
Array
<
MenuItemAction
|
Separator
>
=
[];
const
actions
:
Array
<
MenuItemAction
|
Separator
>
=
[];
const
disabled
=
this
.
configurationService
.
getValue
<
boolean
>
(
'
keyboard.touchbar.enabled
'
)
===
false
;
const
ignoredItems
=
this
.
configurationService
.
getValue
<
string
[]
>
(
'
keyboard.touchbar.ignored
'
)
||
[];
// Fill actions into groups respecting order
// Fill actions into groups respecting order
this
.
touchBarDisposables
.
add
(
createAndFillInActionBarActions
(
this
.
touchBarMenu
,
undefined
,
actions
));
this
.
touchBarDisposables
.
add
(
createAndFillInActionBarActions
(
this
.
touchBarMenu
,
undefined
,
actions
));
// Convert into command action multi array
// Convert into command action multi array
const
items
:
ICommandAction
[][]
=
[];
const
items
:
ICommandAction
[][]
=
[];
let
group
:
ICommandAction
[]
=
[];
let
group
:
ICommandAction
[]
=
[];
const
ignoredItems
=
this
.
configurationService
.
getValue
<
string
[]
>
(
'
keyboard.touchbar.ignored
'
)
||
[];
if
(
!
disabled
)
{
for
(
const
action
of
actions
)
{
for
(
const
action
of
actions
)
{
// Command
if
(
action
instanceof
MenuItemAction
)
{
if
(
ignoredItems
.
indexOf
(
action
.
item
.
id
)
>=
0
)
{
continue
;
// ignored
}
// Command
group
.
push
(
action
.
item
);
if
(
action
instanceof
MenuItemAction
)
{
if
(
ignoredItems
.
indexOf
(
action
.
item
.
id
)
>=
0
)
{
continue
;
// ignored
}
}
group
.
push
(
action
.
item
);
// Separator
}
else
if
(
action
instanceof
Separator
)
{
if
(
group
.
length
)
{
items
.
push
(
group
);
}
// Separator
group
=
[];
else
if
(
action
instanceof
Separator
)
{
if
(
group
.
length
)
{
items
.
push
(
group
);
}
}
group
=
[];
}
}
}
if
(
group
.
length
)
{
if
(
group
.
length
)
{
items
.
push
(
group
);
items
.
push
(
group
);
}
}
}
// Only update if the actions have changed
// Only update if the actions have changed
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录