Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3b8c6c65
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,发现更多精彩内容 >>
提交
3b8c6c65
编写于
3月 26, 2020
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
padding adjustment for output in webview
上级
3b64f229
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
10 deletion
+15
-10
src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
+1
-0
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
+1
-1
src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts
...ntrib/notebook/browser/view/renderers/backLayerWebView.ts
+4
-5
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
...h/contrib/notebook/browser/view/renderers/cellRenderer.ts
+4
-2
src/vs/workbench/contrib/notebook/browser/view/renderers/codeCell.ts
...bench/contrib/notebook/browser/view/renderers/codeCell.ts
+1
-1
src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.ts
...h/contrib/notebook/browser/viewModel/codeCellViewModel.ts
+4
-1
未找到文件。
src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
浏览文件 @
3b8c6c65
...
@@ -40,6 +40,7 @@ export interface CodeCellLayoutInfo {
...
@@ -40,6 +40,7 @@ export interface CodeCellLayoutInfo {
readonly
editorHeight
:
number
;
readonly
editorHeight
:
number
;
readonly
editorWidth
:
number
;
readonly
editorWidth
:
number
;
readonly
totalHeight
:
number
;
readonly
totalHeight
:
number
;
readonly
outputContainerOffset
:
number
;
readonly
outputTotalHeight
:
number
;
readonly
outputTotalHeight
:
number
;
readonly
indicatorHeight
:
number
;
readonly
indicatorHeight
:
number
;
}
}
...
...
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
浏览文件 @
3b8c6c65
...
@@ -792,7 +792,7 @@ registerThemingParticipant((theme, collector) => {
...
@@ -792,7 +792,7 @@ registerThemingParticipant((theme, collector) => {
// Cell Margin
// Cell Margin
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .monaco-list-row > div.cell { margin: 8px
${
CELL_MARGIN
}
px 0px
${
CELL_MARGIN
}
px; }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .monaco-list-row > div.cell { margin: 8px
${
CELL_MARGIN
}
px 0px
${
CELL_MARGIN
}
px; }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .output { margin: 0px
${
CELL_MARGIN
}
px
8
px
${
CELL_MARGIN
+
CELL_RUN_GUTTER
}
px }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .output { margin: 0px
${
CELL_MARGIN
}
px
0
px
${
CELL_MARGIN
+
CELL_RUN_GUTTER
}
px }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .cell .cell-editor-container { width: calc(100% -
${
CELL_RUN_GUTTER
}
px); }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .cell .cell-editor-container { width: calc(100% -
${
CELL_RUN_GUTTER
}
px); }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .monaco-list-row > div.cell.markdown { padding-left:
${
CELL_RUN_GUTTER
}
px; }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .monaco-list-row > div.cell.markdown { padding-left:
${
CELL_RUN_GUTTER
}
px; }`
);
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts
浏览文件 @
3b8c6c65
...
@@ -112,8 +112,7 @@ export class BackLayerWebView extends Disposable {
...
@@ -112,8 +112,7 @@ export class BackLayerWebView extends Disposable {
<style>
<style>
#container > div > div {
#container > div > div {
width: 100%;
width: 100%;
padding: 0 8px;
padding: 8px 0 0 0;
margin: 8px 0;
background-color: var(--vscode-list-inactiveSelectionBackground);
background-color: var(--vscode-list-inactiveSelectionBackground);
}
}
body {
body {
...
@@ -288,7 +287,7 @@ export class BackLayerWebView extends Disposable {
...
@@ -288,7 +287,7 @@ export class BackLayerWebView extends Disposable {
let
cell
=
this
.
insetMapping
.
get
(
output
)
!
.
cell
;
let
cell
=
this
.
insetMapping
.
get
(
output
)
!
.
cell
;
let
height
=
data
.
data
.
height
;
let
height
=
data
.
data
.
height
;
let
outputHeight
=
height
===
0
?
0
:
height
+
16
;
let
outputHeight
=
height
;
if
(
cell
)
{
if
(
cell
)
{
let
outputIndex
=
cell
.
outputs
.
indexOf
(
output
);
let
outputIndex
=
cell
.
outputs
.
indexOf
(
output
);
...
@@ -325,7 +324,7 @@ export class BackLayerWebView extends Disposable {
...
@@ -325,7 +324,7 @@ export class BackLayerWebView extends Disposable {
let
outputIndex
=
cell
.
outputs
.
indexOf
(
output
);
let
outputIndex
=
cell
.
outputs
.
indexOf
(
output
);
let
outputOffsetInOutputContainer
=
cell
.
getOutputOffset
(
outputIndex
);
let
outputOffsetInOutputContainer
=
cell
.
getOutputOffset
(
outputIndex
);
let
outputOffset
=
cellTop
+
cell
.
layoutInfo
.
editorHeight
+
16
/* editor padding */
+
8
+
outputOffsetInOutputContainer
;
let
outputOffset
=
cellTop
+
cell
.
layoutInfo
.
editorHeight
+
outputOffsetInOutputContainer
;
if
(
outputOffset
===
outputCache
.
cacheOffset
)
{
if
(
outputOffset
===
outputCache
.
cacheOffset
)
{
return
false
;
return
false
;
...
@@ -341,7 +340,7 @@ export class BackLayerWebView extends Disposable {
...
@@ -341,7 +340,7 @@ export class BackLayerWebView extends Disposable {
let
outputIndex
=
item
.
cell
.
outputs
.
indexOf
(
item
.
output
);
let
outputIndex
=
item
.
cell
.
outputs
.
indexOf
(
item
.
output
);
let
outputOffsetInOutputContainer
=
item
.
cell
.
getOutputOffset
(
outputIndex
);
let
outputOffsetInOutputContainer
=
item
.
cell
.
getOutputOffset
(
outputIndex
);
let
outputOffset
=
item
.
cellTop
+
item
.
cell
.
layoutInfo
.
editorHeight
+
16
/* editor padding */
+
16
+
outputOffsetInOutputContainer
;
let
outputOffset
=
item
.
cellTop
+
item
.
cell
.
layoutInfo
.
outputContainerOffset
+
outputOffsetInOutputContainer
;
outputCache
.
cacheOffset
=
outputOffset
;
outputCache
.
cacheOffset
=
outputOffset
;
return
{
return
{
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
浏览文件 @
3b8c6c65
...
@@ -117,6 +117,8 @@ abstract class AbstractCellRenderer {
...
@@ -117,6 +117,8 @@ abstract class AbstractCellRenderer {
}
}
});
});
toolbar
.
getContainer
().
style
.
height
=
`
${
EDITOR_TOOLBAR_HEIGHT
}
px`
;
return
toolbar
;
return
toolbar
;
}
}
...
@@ -140,9 +142,9 @@ abstract class AbstractCellRenderer {
...
@@ -140,9 +142,9 @@ abstract class AbstractCellRenderer {
if
(
templateData
.
focusIndicator
)
{
if
(
templateData
.
focusIndicator
)
{
if
(
actions
.
length
)
{
if
(
actions
.
length
)
{
templateData
.
focusIndicator
.
style
.
top
=
`
24
px`
;
templateData
.
focusIndicator
.
style
.
top
=
`
${
EDITOR_TOOLBAR_HEIGHT
+
EDITOR_TOP_PADDING
}
px`
;
}
else
{
}
else
{
templateData
.
focusIndicator
.
style
.
top
=
`
8
px`
;
templateData
.
focusIndicator
.
style
.
top
=
`
${
EDITOR_TOP_PADDING
}
px`
;
}
}
}
}
};
};
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/codeCell.ts
浏览文件 @
3b8c6c65
...
@@ -264,7 +264,7 @@ export class CodeCell extends Disposable {
...
@@ -264,7 +264,7 @@ export class CodeCell extends Disposable {
if
(
result
.
shadowContent
)
{
if
(
result
.
shadowContent
)
{
this
.
viewCell
.
selfSizeMonitoring
=
true
;
this
.
viewCell
.
selfSizeMonitoring
=
true
;
let
editorHeight
=
this
.
viewCell
.
layoutInfo
.
editorHeight
;
let
editorHeight
=
this
.
viewCell
.
layoutInfo
.
editorHeight
;
this
.
notebookEditor
.
createInset
(
this
.
viewCell
,
currOutput
,
result
.
shadowContent
,
editorHeight
+
8
+
this
.
viewCell
.
getOutputOffset
(
index
));
this
.
notebookEditor
.
createInset
(
this
.
viewCell
,
currOutput
,
result
.
shadowContent
,
editorHeight
+
this
.
viewCell
.
getOutputOffset
(
index
));
}
else
{
}
else
{
DOM
.
addClass
(
outputItemDiv
,
'
foreground
'
);
DOM
.
addClass
(
outputItemDiv
,
'
foreground
'
);
}
}
...
...
src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.ts
浏览文件 @
3b8c6c65
...
@@ -83,6 +83,7 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
...
@@ -83,6 +83,7 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
fontInfo
:
null
,
fontInfo
:
null
,
editorHeight
:
0
,
editorHeight
:
0
,
editorWidth
:
0
,
editorWidth
:
0
,
outputContainerOffset
:
0
,
outputTotalHeight
:
0
,
outputTotalHeight
:
0
,
totalHeight
:
0
,
totalHeight
:
0
,
indicatorHeight
:
0
indicatorHeight
:
0
...
@@ -108,12 +109,14 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
...
@@ -108,12 +109,14 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
const
totalHeight
=
this
.
outputs
.
length
const
totalHeight
=
this
.
outputs
.
length
?
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
+
EDITOR_TOP_PADDING
+
16
+
outputTotalHeight
?
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
+
EDITOR_TOP_PADDING
+
16
+
outputTotalHeight
:
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
+
EDITOR_TOP_PADDING
+
outputTotalHeight
;
:
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
+
EDITOR_TOP_PADDING
+
outputTotalHeight
;
const
indicatorHeight
=
totalHeight
-
EDITOR_TOOLBAR_HEIGHT
-
16
;
const
indicatorHeight
=
this
.
editorHeight
+
outputTotalHeight
;
const
outputContainerOffset
=
EDITOR_TOOLBAR_HEIGHT
+
this
.
editorHeight
;
const
editorWidth
=
state
.
outerWidth
!==
undefined
?
state
.
outerWidth
-
CELL_MARGIN
*
2
-
CELL_RUN_GUTTER
:
0
;
const
editorWidth
=
state
.
outerWidth
!==
undefined
?
state
.
outerWidth
-
CELL_MARGIN
*
2
-
CELL_RUN_GUTTER
:
0
;
this
.
_layoutInfo
=
{
this
.
_layoutInfo
=
{
fontInfo
:
state
.
font
||
null
,
fontInfo
:
state
.
font
||
null
,
editorHeight
:
this
.
_editorHeight
,
editorHeight
:
this
.
_editorHeight
,
editorWidth
,
editorWidth
,
outputContainerOffset
,
outputTotalHeight
,
outputTotalHeight
,
totalHeight
,
totalHeight
,
indicatorHeight
indicatorHeight
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录