Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
438a141b
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,体验更适合开发者的 AI 搜索 >>
提交
438a141b
编写于
1月 17, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
electron - avoid more deprecated API (themes)
上级
502f5a57
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
12 deletion
+9
-12
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+2
-2
src/vs/platform/theme/electron-main/themeMainService.ts
src/vs/platform/theme/electron-main/themeMainService.ts
+3
-3
src/vs/platform/windows/electron-main/windowsMainService.ts
src/vs/platform/windows/electron-main/windowsMainService.ts
+4
-7
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
438a141b
...
...
@@ -8,7 +8,7 @@ import * as objects from 'vs/base/common/objects';
import
*
as
nls
from
'
vs/nls
'
;
import
{
Event
as
CommonEvent
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
screen
,
BrowserWindow
,
systemPreferences
,
app
,
TouchBar
,
nativeImage
,
Rectangle
,
Display
,
TouchBarSegmentedControl
,
NativeImage
,
BrowserWindowConstructorOptions
,
SegmentedControlSegment
}
from
'
electron
'
;
import
{
screen
,
BrowserWindow
,
systemPreferences
,
app
,
TouchBar
,
nativeImage
,
Rectangle
,
Display
,
TouchBarSegmentedControl
,
NativeImage
,
BrowserWindowConstructorOptions
,
SegmentedControlSegment
,
nativeTheme
}
from
'
electron
'
;
import
{
IEnvironmentService
,
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -648,7 +648,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
if
(
windowConfig
?.
autoDetectHighContrast
===
false
)
{
autoDetectHighContrast
=
false
;
}
windowConfiguration
.
highContrast
=
isWindows
&&
autoDetectHighContrast
&&
systemPreferences
.
isInvertedColorScheme
()
;
windowConfiguration
.
highContrast
=
isWindows
&&
autoDetectHighContrast
&&
nativeTheme
.
shouldUseInvertedColorScheme
;
windowConfiguration
.
accessibilitySupport
=
app
.
accessibilitySupportEnabled
;
// Title style related
...
...
src/vs/platform/theme/electron-main/themeMainService.ts
浏览文件 @
438a141b
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
isWindows
,
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
systemPreferences
,
ipcMain
as
ipc
}
from
'
electron
'
;
import
{
systemPreferences
,
ipcMain
as
ipc
,
nativeTheme
}
from
'
electron
'
;
import
{
IStateService
}
from
'
vs/platform/state/node/state
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -42,14 +42,14 @@ export class ThemeMainService implements IThemeMainService {
}
getBackgroundColor
():
string
{
if
(
isWindows
&&
systemPreferences
.
isInvertedColorScheme
()
)
{
if
(
isWindows
&&
nativeTheme
.
shouldUseInvertedColorScheme
)
{
return
DEFAULT_BG_HC_BLACK
;
}
let
background
=
this
.
stateService
.
getItem
<
string
|
null
>
(
THEME_BG_STORAGE_KEY
,
null
);
if
(
!
background
)
{
let
baseTheme
:
string
;
if
(
isWindows
&&
systemPreferences
.
isInvertedColorScheme
()
)
{
if
(
isWindows
&&
nativeTheme
.
shouldUseInvertedColorScheme
)
{
baseTheme
=
'
hc-black
'
;
}
else
{
baseTheme
=
this
.
stateService
.
getItem
<
string
>
(
THEME_STORAGE_KEY
,
'
vs-dark
'
).
split
(
'
'
)[
0
];
...
...
src/vs/platform/windows/electron-main/windowsMainService.ts
浏览文件 @
438a141b
...
...
@@ -13,7 +13,7 @@ import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup';
import
{
IEnvironmentService
,
ParsedArgs
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IStateService
}
from
'
vs/platform/state/node/state
'
;
import
{
CodeWindow
,
defaultWindowState
}
from
'
vs/code/electron-main/window
'
;
import
{
ipcMain
as
ipc
,
screen
,
BrowserWindow
,
systemPreferences
,
MessageBoxOptions
,
Display
,
app
}
from
'
electron
'
;
import
{
ipcMain
as
ipc
,
screen
,
BrowserWindow
,
MessageBoxOptions
,
Display
,
app
,
nativeTheme
}
from
'
electron
'
;
import
{
parseLineAndColumnAware
}
from
'
vs/code/node/paths
'
;
import
{
ILifecycleMainService
,
UnloadReason
,
LifecycleMainService
,
LifecycleMainPhase
}
from
'
vs/platform/lifecycle/electron-main/lifecycleMainService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -226,16 +226,13 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// React to HC color scheme changes (Windows)
if
(
isWindows
)
{
const
onHighContrastChange
=
()
=>
{
if
(
systemPreferences
.
isInvertedColorScheme
()
||
systemPreferences
.
isHighContrastColorScheme
()
)
{
nativeTheme
.
on
(
'
updated
'
,
()
=>
{
if
(
nativeTheme
.
shouldUseInvertedColorScheme
||
nativeTheme
.
shouldUseHighContrastColors
)
{
this
.
sendToAll
(
'
vscode:enterHighContrast
'
);
}
else
{
this
.
sendToAll
(
'
vscode:leaveHighContrast
'
);
}
};
systemPreferences
.
on
(
'
inverted-color-scheme-changed
'
,
()
=>
onHighContrastChange
());
systemPreferences
.
on
(
'
high-contrast-color-scheme-changed
'
,
()
=>
onHighContrastChange
());
});
}
// When a window looses focus, save all windows state. This allows to
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录