Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
50e1d67a
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 搜索 >>
提交
50e1d67a
编写于
9月 01, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #11366: Revert the code around terminal.integrated.fontWeight
上级
1a60e57a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
3 addition
and
48 deletion
+3
-48
src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts
.../parts/terminal/electron-browser/terminal.contribution.ts
+0
-4
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
+0
-1
src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts
...h/parts/terminal/electron-browser/terminalConfigHelper.ts
+3
-7
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+0
-2
src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts
...orkbench/parts/terminal/test/terminalConfigHelper.test.ts
+0
-34
未找到文件。
src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts
浏览文件 @
50e1d67a
...
...
@@ -64,10 +64,6 @@ configurationRegistry.registerConfiguration({
'
description
'
:
nls
.
localize
(
'
terminal.integrated.fontFamily
'
,
"
Controls the font family of the terminal, this defaults to editor.fontFamily's value.
"
),
'
type
'
:
'
string
'
},
'
terminal.integrated.fontWeight
'
:
{
'
description
'
:
nls
.
localize
(
'
terminal.integrated.fontWeight
'
,
"
Controls the font weight of the terminal, this defaults to editor.fontWeight's value.
"
),
'
type
'
:
'
string
'
},
'
terminal.integrated.fontLigatures
'
:
{
'
description
'
:
nls
.
localize
(
'
terminal.integrated.fontLigatures
'
,
"
Controls whether font ligatures are enabled in the terminal.
"
),
'
type
'
:
'
boolean
'
,
...
...
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
浏览文件 @
50e1d67a
...
...
@@ -43,7 +43,6 @@ export interface ITerminalConfiguration {
},
cursorBlinking
:
boolean
,
fontFamily
:
string
,
fontWeight
:
string
,
fontLigatures
:
boolean
,
fontSize
:
number
,
lineHeight
:
number
,
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts
浏览文件 @
50e1d67a
...
...
@@ -71,7 +71,6 @@ const DEFAULT_ANSI_COLORS = {
export
interface
ITerminalFont
{
fontFamily
:
string
;
fontWeight
:
string
;
fontSize
:
string
;
lineHeight
:
number
;
charWidth
:
number
;
...
...
@@ -100,7 +99,7 @@ export class TerminalConfigHelper {
return
DEFAULT_ANSI_COLORS
[
baseThemeId
];
}
private
measureFont
(
fontFamily
:
string
,
font
Weight
:
string
,
font
Size
:
number
,
lineHeight
:
number
):
ITerminalFont
{
private
measureFont
(
fontFamily
:
string
,
fontSize
:
number
,
lineHeight
:
number
):
ITerminalFont
{
// Create charMeasureElement if it hasn't been created or if it was orphaned by its parent
if
(
!
this
.
charMeasureElement
||
!
this
.
charMeasureElement
.
parentElement
)
{
this
.
charMeasureElement
=
this
.
panelContainer
.
div
().
getHTMLElement
();
...
...
@@ -108,7 +107,6 @@ export class TerminalConfigHelper {
let
style
=
this
.
charMeasureElement
.
style
;
style
.
display
=
'
block
'
;
style
.
fontFamily
=
fontFamily
;
style
.
fontWeight
=
fontWeight
;
style
.
fontSize
=
fontSize
+
'
px
'
;
style
.
height
=
Math
.
floor
(
lineHeight
*
fontSize
)
+
'
px
'
;
this
.
charMeasureElement
.
innerText
=
'
X
'
;
...
...
@@ -118,7 +116,6 @@ export class TerminalConfigHelper {
let
charHeight
=
Math
.
ceil
(
rect
.
height
);
return
{
fontFamily
,
fontWeight
,
fontSize
:
fontSize
+
'
px
'
,
lineHeight
,
charWidth
,
...
...
@@ -127,7 +124,7 @@ export class TerminalConfigHelper {
}
/**
* Gets the font information based on the terminal.integrated.fontFamily
, terminal.integrated.fontWeight
* Gets the font information based on the terminal.integrated.fontFamily
* terminal.integrated.fontSize, terminal.integrated.lineHeight configuration properties
*/
public
getFont
():
ITerminalFont
{
...
...
@@ -135,14 +132,13 @@ export class TerminalConfigHelper {
let
editorConfig
=
this
.
configurationService
.
getConfiguration
<
IConfiguration
>
();
let
fontFamily
=
terminalConfig
.
fontFamily
||
editorConfig
.
editor
.
fontFamily
;
let
fontWeight
=
terminalConfig
.
fontWeight
||
editorConfig
.
editor
.
fontWeight
;
let
fontSize
=
this
.
toInteger
(
terminalConfig
.
fontSize
,
0
)
||
editorConfig
.
editor
.
fontSize
;
if
(
fontSize
<=
0
)
{
fontSize
=
DefaultConfig
.
editor
.
fontSize
;
}
let
lineHeight
=
this
.
toInteger
(
terminalConfig
.
lineHeight
,
DEFAULT_LINE_HEIGHT
);
return
this
.
measureFont
(
fontFamily
,
font
Weight
,
font
Size
,
lineHeight
<=
0
?
DEFAULT_LINE_HEIGHT
:
lineHeight
);
return
this
.
measureFont
(
fontFamily
,
fontSize
,
lineHeight
<=
0
?
DEFAULT_LINE_HEIGHT
:
lineHeight
);
}
public
getFontLigaturesEnabled
():
boolean
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
50e1d67a
...
...
@@ -330,7 +330,6 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
if
(
!
this
.
font
||
this
.
fontsDiffer
(
this
.
font
,
newFont
))
{
this
.
fontStyleElement
.
innerHTML
=
'
.monaco-workbench .panel.integrated-terminal .xterm {
'
+
`font-family:
${
newFont
.
fontFamily
}
;`
+
`font-weight:
${
newFont
.
fontWeight
}
;`
+
`font-size:
${
newFont
.
fontSize
}
;`
+
`line-height:
${
newFont
.
lineHeight
}
;`
+
'
}
'
;
...
...
@@ -344,7 +343,6 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
return
a
.
charHeight
!==
b
.
charHeight
||
a
.
charWidth
!==
b
.
charWidth
||
a
.
fontFamily
!==
b
.
fontFamily
||
a
.
fontWeight
!==
b
.
fontWeight
||
a
.
fontSize
!==
b
.
fontSize
||
a
.
lineHeight
!==
b
.
lineHeight
;
}
...
...
src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts
浏览文件 @
50e1d67a
...
...
@@ -61,40 +61,6 @@ suite('Workbench - TerminalConfigHelper', () => {
assert
.
equal
(
configHelper
.
getFont
().
fontFamily
,
'
foo
'
,
'
editor.fontFamily should be the fallback when terminal.integrated.fontFamily not set
'
);
});
test
(
'
TerminalConfigHelper - getFont fontWeight
'
,
function
()
{
let
configurationService
:
IConfigurationService
;
let
configHelper
:
TerminalConfigHelper
;
configurationService
=
new
MockConfigurationService
({
editor
:
{
fontFamily
:
'
foo
'
,
fontWeight
:
'
lighter
'
},
terminal
:
{
integrated
:
{
fontFamily
:
'
bar
'
,
fontWeight
:
'
bold
'
}
}
});
configHelper
=
new
TerminalConfigHelper
(
Platform
.
Linux
,
configurationService
,
fixture
);
assert
.
equal
(
configHelper
.
getFont
().
fontWeight
,
'
bold
'
,
'
terminal.integrated.fontWeight should be selected over editor.fontWeight
'
);
configurationService
=
new
MockConfigurationService
({
editor
:
{
fontFamily
:
'
foo
'
,
fontWeight
:
'
lighter
'
},
terminal
:
{
integrated
:
{
fontFamily
:
0
}
}
});
configHelper
=
new
TerminalConfigHelper
(
Platform
.
Linux
,
configurationService
,
fixture
);
assert
.
equal
(
configHelper
.
getFont
().
fontWeight
,
'
lighter
'
,
'
editor.fontWeight should be the fallback when terminal.integrated.fontWeight not set
'
);
});
test
(
'
TerminalConfigHelper - getFont fontSize
'
,
function
()
{
let
configurationService
:
IConfigurationService
;
let
configHelper
:
TerminalConfigHelper
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录