From 678e32a80f2730467071300fee94ee0e2e844799 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Fri, 27 Jun 2025 12:32:11 -0400 Subject: [PATCH] Use tooltipvisibility, don't mess with tooltips for non-selected modes --- .../toolbar/widgets/select_mode_buttons.dart | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/lib/pangea/toolbar/widgets/select_mode_buttons.dart b/lib/pangea/toolbar/widgets/select_mode_buttons.dart index 0025ff800..1a5ff426b 100644 --- a/lib/pangea/toolbar/widgets/select_mode_buttons.dart +++ b/lib/pangea/toolbar/widgets/select_mode_buttons.dart @@ -488,25 +488,28 @@ class SelectModeButtonsState extends State { spacing: 4.0, children: [ for (final mode in modes) - Tooltip( - message: _isError ? null : mode.tooltip(context), - child: PressableButton( - depressed: mode == _selectedMode, - borderRadius: BorderRadius.circular(20), - color: Theme.of(context).colorScheme.primaryContainer, - onPressed: () => _updateMode(mode), - playSound: mode != SelectMode.audio, - colorFactor: Theme.of(context).brightness == Brightness.light - ? 0.55 - : 0.3, - child: Container( - height: buttonSize, - width: buttonSize, - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primaryContainer, - shape: BoxShape.circle, + TooltipVisibility( + visible: (!_isError || mode != _selectedMode), + child: Tooltip( + message: mode.tooltip(context), + child: PressableButton( + depressed: mode == _selectedMode, + borderRadius: BorderRadius.circular(20), + color: Theme.of(context).colorScheme.primaryContainer, + onPressed: () => _updateMode(mode), + playSound: mode != SelectMode.audio, + colorFactor: Theme.of(context).brightness == Brightness.light + ? 0.55 + : 0.3, + child: Container( + height: buttonSize, + width: buttonSize, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.primaryContainer, + shape: BoxShape.circle, + ), + child: icon(mode), ), - child: icon(mode), ), ), ),