toolbar: specify image width/height

This make the button the right size while waiting for the image to download.

Fixes: https://github.com/pybricks/support/issues/369
This commit is contained in:
David Lechner
2021-12-27 12:38:50 -06:00
parent 11e0fefb1d
commit 6dc4dcb2e5
3 changed files with 18 additions and 2 deletions
+5
View File
@@ -4,6 +4,11 @@
## [Unreleased]
### Fixed
- Fixed buttons wrong size while image is downloading ([support#369]).
[support#369]: https://github.com/pybricks/support/issues/369
## [1.1.0] - 2021-12-16
### Changed
+10 -1
View File
@@ -1,7 +1,14 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2020-2021 The Pybricks Authors
import { Button, IRef, Intent, Spinner, useHotkeys } from '@blueprintjs/core';
import {
Button,
IRef,
Intent,
Spinner,
SpinnerSize,
useHotkeys,
} from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
import { useI18n } from '@shopify/react-i18n';
import React, { useMemo } from 'react';
@@ -93,6 +100,8 @@ const ActionButton: React.FC<ActionButtonProps> = (props) => {
<Spinner value={props.progress} intent={Intent.PRIMARY} />
) : (
<img
width={`${SpinnerSize.STANDARD}px`}
height={`${SpinnerSize.STANDARD}px`}
src={props.icon}
alt={props.id}
style={{ pointerEvents: 'none' }}
+3 -1
View File
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2020-2021 The Pybricks Authors
import { Button, IRef, Intent, Spinner } from '@blueprintjs/core';
import { Button, IRef, Intent, Spinner, SpinnerSize } from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
import { useI18n } from '@shopify/react-i18n';
import React from 'react';
@@ -116,6 +116,8 @@ const OpenFileButton: React.FC<OpenFileButtonProps> = (props) => {
<Spinner value={props.progress} intent={Intent.PRIMARY} />
) : (
<img
width={`${SpinnerSize.STANDARD}px`}
height={`${SpinnerSize.STANDARD}px`}
src={props.icon}
alt={props.id}
style={{ pointerEvents: 'none' }}