From fea29fbe834d97aebd8847d50fe01e4ca3be9109 Mon Sep 17 00:00:00 2001 From: xnkevinnguyen Date: Mon, 2 Mar 2020 10:52:54 -0800 Subject: [PATCH 1/4] Ab text fix --- src/view/components/cpx/CpxImage.tsx | 2 +- src/view/components/cpx/Cpx_svg_style.tsx | 4 ++++ src/view/components/microbit/Microbit_svg.tsx | 2 +- src/view/styles/Microbit.css | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/view/components/cpx/CpxImage.tsx b/src/view/components/cpx/CpxImage.tsx index fd3688b12..34a604c7f 100644 --- a/src/view/components/cpx/CpxImage.tsx +++ b/src/view/components/cpx/CpxImage.tsx @@ -155,7 +155,7 @@ const initSvgStyle = (svgElement: HTMLElement, brightness: number): void => { const ab = outerBtn(165, SvgStyle.MB_HEIGHT - 15, "A+B"); const abtext = svg.child(ab.outer, "text", { - class: "sim-text", + class: "sim-text-outside", x: SvgStyle.BUTTON_TEXT_BASELINE, y: SvgStyle.MB_HEIGHT - 18, }) as SVGTextElement; diff --git a/src/view/components/cpx/Cpx_svg_style.tsx b/src/view/components/cpx/Cpx_svg_style.tsx index 72ba0e18a..de0cda634 100644 --- a/src/view/components/cpx/Cpx_svg_style.tsx +++ b/src/view/components/cpx/Cpx_svg_style.tsx @@ -141,6 +141,10 @@ export const SVG_STYLE = ` fill:#fff; pointer-events: none; user-select: none; } + .sim-text-outside{ + font-size:8px; + fill: var(--vscode-textLink-activeForeground); + } .sim-text.small { font-size:6px; } diff --git a/src/view/components/microbit/Microbit_svg.tsx b/src/view/components/microbit/Microbit_svg.tsx index 3cfe352e1..b4cefbc77 100644 --- a/src/view/components/microbit/Microbit_svg.tsx +++ b/src/view/components/microbit/Microbit_svg.tsx @@ -1770,7 +1770,7 @@ export class MicrobitSvg extends React.Component { fill="#111" style={{ fill: "rgb(17, 17, 17)" }} /> - + A+B Date: Mon, 2 Mar 2020 17:30:26 -0800 Subject: [PATCH 2/4] Use description foreground --- src/view/components/cpx/Cpx_svg_style.tsx | 2 +- src/view/styles/Microbit.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/view/components/cpx/Cpx_svg_style.tsx b/src/view/components/cpx/Cpx_svg_style.tsx index de0cda634..4eff14480 100644 --- a/src/view/components/cpx/Cpx_svg_style.tsx +++ b/src/view/components/cpx/Cpx_svg_style.tsx @@ -143,7 +143,7 @@ export const SVG_STYLE = ` } .sim-text-outside{ font-size:8px; - fill: var(--vscode-textLink-activeForeground); + fill: var(--vscode-descriptionForeground); } .sim-text.small { font-size:6px; diff --git a/src/view/styles/Microbit.css b/src/view/styles/Microbit.css index bc83e57c8..681a7fe12 100644 --- a/src/view/styles/Microbit.css +++ b/src/view/styles/Microbit.css @@ -24,7 +24,7 @@ svg.sim.grayscale { } .sim-text-outside { font-size: 25px; - fill: var(--vscode-textLink-activeForeground); + fill: var(--vscode-descriptionForeground); } .sim-board, .sim-display, From 5978085e63b42d1c68a8c72fb52d16839d923f14 Mon Sep 17 00:00:00 2001 From: xnkevinnguyen Date: Tue, 3 Mar 2020 11:09:29 -0800 Subject: [PATCH 3/4] Lint files --- src/extension.ts | 6 +++--- src/extension_utils/utils.ts | 2 +- src/view/components/microbit/MicrobitImage.tsx | 2 +- src/view/components/microbit/MicrobitSimulator.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index c14532a0a..18a7e9442 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,6 +3,7 @@ import * as cp from "child_process"; import * as fs from "fs"; +import { registerDefaultFontFaces } from "office-ui-fabric-react"; import * as open from "open"; import * as os from "os"; import * as path from "path"; @@ -25,13 +26,12 @@ import * as utils from "./extension_utils/utils"; import { SerialMonitor } from "./serialMonitor"; import { DebuggerCommunicationService } from "./service/debuggerCommunicationService"; import { MessagingService } from "./service/messagingService"; +import { PopupService } from "./service/PopupService"; import { SimulatorDebugConfigurationProvider } from "./simulatorDebugConfigurationProvider"; +import getPackageInfo from "./telemetry/getPackageInfo"; import TelemetryAI from "./telemetry/telemetryAI"; import { UsbDetector } from "./usbDetector"; import { VSCODE_MESSAGES_TO_WEBVIEW, WEBVIEW_MESSAGES } from "./view/constants"; -import { PopupService } from "./service/PopupService"; -import getPackageInfo from "./telemetry/getPackageInfo"; -import { registerDefaultFontFaces } from "office-ui-fabric-react"; let currentFileAbsPath: string = ""; let currentTextDocument: vscode.TextDocument; diff --git a/src/extension_utils/utils.ts b/src/extension_utils/utils.ts index ba51c6815..8a3021316 100644 --- a/src/extension_utils/utils.ts +++ b/src/extension_utils/utils.ts @@ -561,7 +561,7 @@ export const setupEnv = async ( ) => { const originalpythonExecutablePath = await getCurrentpythonExecutablePath(); let pythonExecutablePath = originalpythonExecutablePath; - let pythonExecutableName: string = + const pythonExecutableName: string = os.platform() === "win32" ? HELPER_FILES.PYTHON_EXE : HELPER_FILES.PYTHON; diff --git a/src/view/components/microbit/MicrobitImage.tsx b/src/view/components/microbit/MicrobitImage.tsx index 326d0a611..4ee638241 100644 --- a/src/view/components/microbit/MicrobitImage.tsx +++ b/src/view/components/microbit/MicrobitImage.tsx @@ -3,8 +3,8 @@ import * as React from "react"; import { VIEW_STATE } from "../../constants"; -import { ViewStateContext } from "../../context"; import CONSTANTS, { MICROBIT_BUTTON_STYLING_CLASSES } from "../../constants"; +import { ViewStateContext } from "../../context"; import "../../styles/Microbit.css"; import { IRefObject, MicrobitSvg } from "./Microbit_svg"; diff --git a/src/view/components/microbit/MicrobitSimulator.tsx b/src/view/components/microbit/MicrobitSimulator.tsx index c05611396..3d4258d64 100644 --- a/src/view/components/microbit/MicrobitSimulator.tsx +++ b/src/view/components/microbit/MicrobitSimulator.tsx @@ -10,7 +10,7 @@ import StopLogo from "../../svgs/stop_svg"; import { sendMessage } from "../../utils/MessageUtils"; import Dropdown from "../Dropdown"; import ActionBar from "../simulator/ActionBar"; -import { MicrobitImage, BUTTONS_KEYS } from "./MicrobitImage"; +import { BUTTONS_KEYS, MicrobitImage } from "./MicrobitImage"; const DEFAULT_MICROBIT_STATE: IMicrobitState = { leds: [ From f1a8e1554c96c2b686f5dfee143dea62b2a8e8fd Mon Sep 17 00:00:00 2001 From: xnkevinnguyen Date: Tue, 3 Mar 2020 13:10:57 -0800 Subject: [PATCH 4/4] Update test with css change --- src/view/container/device/__snapshots__/Device.spec.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/container/device/__snapshots__/Device.spec.tsx.snap b/src/view/container/device/__snapshots__/Device.spec.tsx.snap index 9dc44822d..5340ff299 100644 --- a/src/view/container/device/__snapshots__/Device.spec.tsx.snap +++ b/src/view/container/device/__snapshots__/Device.spec.tsx.snap @@ -2472,7 +2472,7 @@ exports[`Device component should render correctly 1`] = ` } />