From 29d1fcc534dbd574ddc3d2ec5dbd048ad437c679 Mon Sep 17 00:00:00 2001 From: David Kutugata Date: Wed, 2 Oct 2019 14:47:17 -0700 Subject: [PATCH 1/8] Make interactive window and native editor take their fontSize and fontFamily from the settings in VS Code. We get them in nativeEditor.tsx and in interactivePanel.tsx to apply them as styles, but we also need to send them as props to eventually assign them in the monaco editor. --- news/2 Fixes/7624.md | 1 + package-lock.json | 6 ++-- .../history-react/interactiveCell.tsx | 4 +++ .../history-react/interactivePanel.tsx | 36 ++++++++++++++----- .../interactive-common/cellInput.tsx | 6 ++++ .../interactive-common/code.tsx | 4 +++ .../interactive-common/contentPanel.tsx | 8 +++-- .../interactive-common/editor.tsx | 4 +++ .../interactive-common/markdown.tsx | 4 +++ .../native-editor/nativeCell.tsx | 4 +++ .../native-editor/nativeEditor.tsx | 30 ++++++++++++---- 11 files changed, 85 insertions(+), 22 deletions(-) create mode 100644 news/2 Fixes/7624.md diff --git a/news/2 Fixes/7624.md b/news/2 Fixes/7624.md new file mode 100644 index 000000000000..1875f4ca313b --- /dev/null +++ b/news/2 Fixes/7624.md @@ -0,0 +1 @@ +Make interactive window and native take their fontSize and fontFamily from the settings in VS Code. diff --git a/package-lock.json b/package-lock.json index 8f8d69e788ab..7954b5c3bf06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13770,7 +13770,7 @@ "dependencies": { "buffer": { "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { @@ -13793,7 +13793,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -18754,7 +18754,7 @@ "dependencies": { "json5": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "dev": true, "requires": { diff --git a/src/datascience-ui/history-react/interactiveCell.tsx b/src/datascience-ui/history-react/interactiveCell.tsx index f00a13214649..e4462466758a 100644 --- a/src/datascience-ui/history-react/interactiveCell.tsx +++ b/src/datascience-ui/history-react/interactiveCell.tsx @@ -39,6 +39,8 @@ interface IInteractiveCellProps { focusedCell?: string; hideOutput?: boolean; showLineNumbers?: boolean; + fontSize: number; + fontFamily: string; onCodeChange(changes: monacoEditor.editor.IModelContentChange[], cellId: string, modelId: string): void; onCodeCreated(code: string, file: string, cellId: string, modelId: string): void; openLink(uri: monacoEditor.Uri): void; @@ -211,6 +213,8 @@ export class InteractiveCell extends React.Component { unfocused={this.onCodeUnfocused} keyDown={this.props.keyDown} showLineNumbers={this.props.showLineNumbers} + fontSize={this.props.fontSize} + fontFamily={this.props.fontFamily} /> ); } diff --git a/src/datascience-ui/history-react/interactivePanel.tsx b/src/datascience-ui/history-react/interactivePanel.tsx index 0d978809a73d..a104787731bc 100644 --- a/src/datascience-ui/history-react/interactivePanel.tsx +++ b/src/datascience-ui/history-react/interactivePanel.tsx @@ -67,6 +67,18 @@ export class InteractivePanel extends React.Component : undefined; @@ -77,7 +89,7 @@ export class InteractivePanel extends React.Component +