Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/extension_utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,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;
Expand Down
2 changes: 1 addition & 1 deletion src/view/components/cpx/CpxImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,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;
Expand Down
4 changes: 4 additions & 0 deletions src/view/components/cpx/Cpx_svg_style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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-descriptionForeground);
}
Comment on lines +144 to +147

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we have some overlapping CSS code between the CPX and micro:bit. Might be worth considering sharing it between the components.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, right now the way it is applied on cpx and microbit is different, this can be done if we refactor cpx. (the microbit implementation is more solid as well, so it will be worth doing it)

.sim-text.small {
font-size:6px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/components/microbit/MicrobitImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/view/components/microbit/MicrobitSimulator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion src/view/components/microbit/Microbit_svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ export class MicrobitSvg extends React.Component {
fill="#111"
style={{ fill: "rgb(17, 17, 17)" }}
/>
<text x={525} y={340} className="sim-text">
<text x={525} y={340} className="sim-text-outside">
A+B
</text>
<g
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2472,7 +2472,7 @@ exports[`Device component should render correctly 1`] = `
}
/>
<text
className="sim-text"
className="sim-text-outside"
x={525}
y={340}
>
Expand Down
5 changes: 4 additions & 1 deletion src/view/styles/Microbit.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ svg.sim.grayscale {
.sim-button:active {
fill: orange;
}

.sim-text-outside {
font-size: 25px;
fill: var(--vscode-descriptionForeground);
}
.sim-board,
.sim-display,
sim-button {
Expand Down