From 13656d739c9cda607e9384b158bf277ca315c2cd Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Mon, 15 Apr 2024 17:01:19 +0200 Subject: [PATCH] Show busy icon icon dialog titlebar when identify requests are pending --- components/ResizeableWindow.jsx | 4 +++- components/style/ResizeableWindow.css | 11 +++++++++++ plugins/Identify.jsx | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/components/ResizeableWindow.jsx b/components/ResizeableWindow.jsx index 91974623c..25e83bc5b 100644 --- a/components/ResizeableWindow.jsx +++ b/components/ResizeableWindow.jsx @@ -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'; @@ -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]), @@ -188,7 +190,7 @@ class ResizeableWindow extends React.Component { const content = [ (
{ this.titlebar = el; }}> - {icon} + {this.props.busyIcon ? () : icon} {this.props.title ? LocaleUtils.tr(this.props.title) : (this.props.titlelabel || "")} diff --git a/components/style/ResizeableWindow.css b/components/style/ResizeableWindow.css index 0b4d1dec3..156858e7c 100644 --- a/components/style/ResizeableWindow.css +++ b/components/style/ResizeableWindow.css @@ -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; diff --git a/plugins/Identify.jsx b/plugins/Identify.jsx index 31ed3778d..5a40481c6 100644 --- a/plugins/Identify.jsx +++ b/plugins/Identify.jsx @@ -377,7 +377,7 @@ class Identify extends React.Component { ); } resultWindow = ( - 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"