mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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' }}
|
||||
|
||||
@@ -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' }}
|
||||
|
||||
Reference in New Issue
Block a user