layout: make TTS icon less distracting during read-aloud mode (#2198)

This commit is contained in:
Huang Xin
2025-10-11 01:14:57 +08:00
committed by GitHub
parent ada427b134
commit 00af4a3d60
2 changed files with 13 additions and 3 deletions
@@ -95,7 +95,9 @@ const FooterBar: React.FC<FooterBarProps> = ({
setActionTab((prevTab) => (prevTab === tab ? '' : tab));
if (tab === 'tts') {
setHoveredBookKey('');
if (viewState?.ttsEnabled) {
setHoveredBookKey('');
}
handleSpeakText();
} else if (tab === 'toc') {
setHoveredBookKey('');
@@ -113,7 +115,15 @@ const FooterBar: React.FC<FooterBarProps> = ({
}
}
},
[config, bookKey, setConfig, setSideBarVisible, setHoveredBookKey, handleSpeakText],
[
config,
bookKey,
viewState?.ttsEnabled,
setConfig,
setSideBarVisible,
setHoveredBookKey,
handleSpeakText,
],
);
useEffect(() => {
@@ -550,7 +550,7 @@ const TTSControl: React.FC<TTSControlProps> = ({ bookKey, gridInsets }) => {
return (
<>
{showPanel && <Overlay onDismiss={handleDismissPopup} />}
{showIndicator && (
{showIndicator && hoveredBookKey === bookKey && (
<div
ref={iconRef}
className={clsx(