fix theme for SessionRecording

pull/1381/head
Audric Ackermann 4 years ago
parent 8a014301cf
commit a23d5cd95c
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -16,7 +16,7 @@
"scripts": { "scripts": {
"prepare": "patch-package", "prepare": "patch-package",
"postinstall": "yarn custom-react-mentions-build && electron-builder install-app-deps && rimraf node_modules/dtrace-provider", "postinstall": "yarn custom-react-mentions-build && electron-builder install-app-deps && rimraf node_modules/dtrace-provider",
"custom-react-mentions-build": "cd node_modules/react-mentions && yarn install --node_modules=../node_modules && yarn build; rimraf node_modules/react node_modules/react-dom; cd -", "custom-react-mentions-build": "cd node_modules/react-mentions && yarn install --node_modules=../node_modules && yarn build && rimraf node_modules/react node_modules/react-dom && cd ..",
"start": "cross-env NODE_APP_INSTANCE=$MULTI electron .", "start": "cross-env NODE_APP_INSTANCE=$MULTI electron .",
"start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron .", "start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron .",
"start-swarm-test": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=$MULTI electron .", "start-swarm-test": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=$MULTI electron .",
@ -334,4 +334,4 @@
"!dev-app-update.yml" "!dev-app-update.yml"
] ]
} }
} }

@ -379,6 +379,7 @@
justify-content: center; justify-content: center;
position: absolute; position: absolute;
left: 0; left: 0;
z-index: 2;
right: 0; right: 0;
bottom: $composition-container-height + $session-margin-md; bottom: $composition-container-height + $session-margin-md;

@ -46,8 +46,6 @@ interface State {
barRadius: number; barRadius: number;
barWidth: number; barWidth: number;
barPadding: number; barPadding: number;
barColorInit: string;
barColorPlay: string;
maxBarHeight: number; maxBarHeight: number;
minBarHeight: number; minBarHeight: number;
}; };
@ -63,7 +61,7 @@ class SessionRecordingInner extends React.Component<Props, State> {
private readonly visualisationCanvas: React.RefObject<HTMLCanvasElement>; private readonly visualisationCanvas: React.RefObject<HTMLCanvasElement>;
private readonly playbackCanvas: React.RefObject<HTMLCanvasElement>; private readonly playbackCanvas: React.RefObject<HTMLCanvasElement>;
constructor(props: any) { constructor(props: Props) {
super(props); super(props);
// Mouse interaction // Mouse interaction
@ -118,8 +116,6 @@ class SessionRecordingInner extends React.Component<Props, State> {
barRadius: 15, barRadius: 15,
barWidth: 4, barWidth: 4,
barPadding: 3, barPadding: 3,
barColorInit: Constants.UI.COLORS.WHITE_PALE,
barColorPlay: Constants.UI.COLORS.WHITE,
maxBarHeight: 30, maxBarHeight: 30,
minBarHeight: 3, minBarHeight: 3,
}, },
@ -353,7 +349,8 @@ class SessionRecordingInner extends React.Component<Props, State> {
// Draw sweeping timeline // Draw sweeping timeline
const drawSweepingTimeline = () => { const drawSweepingTimeline = () => {
const { isPaused } = this.state; const { isPaused } = this.state;
const { width, height, barColorPlay } = this.state.canvasParams; const { textColor } = this.props.theme.colors;
const { width, height } = this.state.canvasParams;
const canvas = this.playbackCanvas.current; const canvas = this.playbackCanvas.current;
if (!canvas || isPaused) { if (!canvas || isPaused) {
@ -373,7 +370,7 @@ class SessionRecordingInner extends React.Component<Props, State> {
} }
canvasContext.beginPath(); canvasContext.beginPath();
canvasContext.fillStyle = barColorPlay; canvasContext.fillStyle = textColor;
canvasContext.globalCompositeOperation = 'source-atop'; canvasContext.globalCompositeOperation = 'source-atop';
canvasContext.fillRect(0, 0, progress, height); canvasContext.fillRect(0, 0, progress, height);
@ -502,13 +499,13 @@ class SessionRecordingInner extends React.Component<Props, State> {
processor.onaudioprocess = () => { processor.onaudioprocess = () => {
const streamParams = { stream, media, input, processor }; const streamParams = { stream, media, input, processor };
this.setState({ streamParams }); this.setState({ streamParams });
const { textColorSubtle } = this.props.theme.colors;
const { const {
width, width,
height, height,
barWidth, barWidth,
barPadding, barPadding,
barColorInit,
maxBarHeight, maxBarHeight,
minBarHeight, minBarHeight,
} = this.state.canvasParams; } = this.state.canvasParams;
@ -559,7 +556,7 @@ class SessionRecordingInner extends React.Component<Props, State> {
const offsetY = Math.ceil(height / 2 - barHeight / 2); const offsetY = Math.ceil(height / 2 - barHeight / 2);
if (canvasContext) { if (canvasContext) {
canvasContext.fillStyle = barColorInit; canvasContext.fillStyle = textColorSubtle;
this.drawRoundedRect(canvasContext, offsetX, offsetY, barHeight); this.drawRoundedRect(canvasContext, offsetX, offsetY, barHeight);
} }
} }
@ -613,11 +610,12 @@ class SessionRecordingInner extends React.Component<Props, State> {
height, height,
barWidth, barWidth,
barPadding, barPadding,
barColorInit,
maxBarHeight, maxBarHeight,
minBarHeight, minBarHeight,
} = this.state.canvasParams; } = this.state.canvasParams;
const { textColorSubtle } = this.props.theme.colors;
const numBars = width / (barPadding + barWidth); const numBars = width / (barPadding + barWidth);
// Scan through audio file getting average volume per bar // Scan through audio file getting average volume per bar
@ -672,7 +670,7 @@ class SessionRecordingInner extends React.Component<Props, State> {
const offsetX = Math.ceil(i * (barWidth + barPadding)); const offsetX = Math.ceil(i * (barWidth + barPadding));
const offsetY = Math.ceil(height / 2 - barHeight / 2); const offsetY = Math.ceil(height / 2 - barHeight / 2);
canvasContext.fillStyle = barColorInit; canvasContext.fillStyle = textColorSubtle;
this.drawRoundedRect(canvasContext, offsetX, offsetY, barHeight); this.drawRoundedRect(canvasContext, offsetX, offsetY, barHeight);
} }

Loading…
Cancel
Save