Change tooltip handling

pull/1182/head
BambinoUA 2 years ago
parent 1684bd2c8c
commit c74c0e358a
  1. 36
      lib/src/widgets/toolbar/quill_font_family_button.dart

@ -117,8 +117,18 @@ class _QuillFontFamilyButtonState extends State<QuillFontFamilyButton> {
height: widget.iconSize * 1.81, height: widget.iconSize * 1.81,
width: widget.width, width: widget.width,
), ),
child: UtilityWidgets.maybeTooltip( child: UtilityWidgets.maybeWidget(
message: widget.tooltip, enabled: (widget.tooltip ?? '').isNotEmpty ||
widget.overrideTooltipByFontFamily,
wrapper: (child) {
var effectiveTooltip = widget.tooltip ?? '';
if (widget.overrideTooltipByFontFamily) {
effectiveTooltip = effectiveTooltip.isNotEmpty
? '$effectiveTooltip: $_currentValue'
: '${'Font'.i18n}: $_currentValue';
}
return Tooltip(message: effectiveTooltip, child: child);
},
child: RawMaterialButton( child: RawMaterialButton(
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -198,19 +208,15 @@ class _QuillFontFamilyButtonState extends State<QuillFontFamilyButton> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: UtilityWidgets.maybeWidget( child: Text(
enabled: widget.overrideTooltipByFontFamily, _currentValue,
wrapper: (child) => Tooltip(message: _currentValue, child: child), maxLines: 1,
child: Text( overflow: widget.labelOverflow,
_currentValue, style: widget.style ??
maxLines: 1, TextStyle(
overflow: widget.labelOverflow, fontSize: widget.iconSize / 1.15,
style: widget.style ?? color: widget.iconTheme?.iconUnselectedColor ??
TextStyle( theme.iconTheme.color),
fontSize: widget.iconSize / 1.15,
color: widget.iconTheme?.iconUnselectedColor ??
theme.iconTheme.color),
),
), ),
), ),
const SizedBox(width: 3), const SizedBox(width: 3),

Loading…
Cancel
Save