Skip to content

Commit

Permalink
Show busy icon icon dialog titlebar when identify requests are pending
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Apr 15, 2024
1 parent 1ecd0ad commit 13656d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion components/ResizeableWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {raiseWindow, registerWindow, unregisterWindow, setSplitScreen} from '../
import ConfigUtils from '../utils/ConfigUtils';
import LocaleUtils from '../utils/LocaleUtils';
import Icon from './Icon';
import Spinner from './Spinner';

import './style/ResizeableWindow.css';

Expand All @@ -26,6 +27,7 @@ const WINDOW_GEOMETRIES = {};
class ResizeableWindow extends React.Component {
static propTypes = {
baseZIndex: PropTypes.number,
busyIcon: PropTypes.bool,
bottombarHeight: PropTypes.number,
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
dockable: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
Expand Down Expand Up @@ -188,7 +190,7 @@ class ResizeableWindow extends React.Component {

const content = [
(<div className="resizeable-window-titlebar" key="titlebar" onDoubleClick={this.toggleMaximize} ref={el => { this.titlebar = el; }}>
{icon}
{this.props.busyIcon ? (<Spinner />) : icon}
<span className="resizeable-window-titlebar-title">
{this.props.title ? LocaleUtils.tr(this.props.title) : (this.props.titlelabel || "")}
</span>
Expand Down
11 changes: 11 additions & 0 deletions components/style/ResizeableWindow.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ div.resizeable-window-titlebar {
flex: 0 0 auto;
}

div.resizeable-window-titlebar > div.spinner {
flex: 0 0 auto;
margin-right: 0.25em;
width: 1.5em;
height: 1.5em;
}

div.resizeable-window-titlebar > div.spinner > div {
background-color: var(--titlebar-text-color);
}

span.resizeable-window-titlebar-icon {
flex: 0 0 auto;
margin-right: 0.25em;
Expand Down
2 changes: 1 addition & 1 deletion plugins/Identify.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class Identify extends React.Component {
);
}
resultWindow = (
<ResizeableWindow dockable={this.props.geometry.side} icon="info-sign"
<ResizeableWindow busyIcon={this.state.pendingRequests > 0} dockable={this.props.geometry.side} icon="info-sign"
initialHeight={this.props.geometry.initialHeight} initialWidth={this.props.geometry.initialWidth}
initialX={this.props.geometry.initialX} initialY={this.props.geometry.initialY}
initiallyDocked={this.props.geometry.initiallyDocked} key="IdentifyWindow"
Expand Down

0 comments on commit 13656d7

Please sign in to comment.