Remove tooltip for LinkStyleButton

pull/895/head
X Code 3 years ago
parent 6d24b24878
commit 81720861b2
  1. 54
      lib/src/widgets/toolbar/link_style_button.dart

@ -56,49 +56,29 @@ class _LinkStyleButtonState extends State<LinkStyleButton> {
widget.controller.removeListener(_didChangeSelection); widget.controller.removeListener(_didChangeSelection);
} }
final GlobalKey _toolTipKey = GlobalKey();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
final isToggled = _getLinkAttributeValue() != null; final isToggled = _getLinkAttributeValue() != null;
final pressedHandler = () => _openLinkDialog(context); final pressedHandler = () => _openLinkDialog(context);
return GestureDetector( return QuillIconButton(
onTap: () async { highlightElevation: 0,
final dynamic tooltip = _toolTipKey.currentState; hoverElevation: 0,
tooltip.ensureTooltipVisible(); size: widget.iconSize * kIconButtonFactor,
Future.delayed( icon: Icon(
const Duration( widget.icon ?? Icons.link,
seconds: 3, size: widget.iconSize,
), color: isToggled
tooltip.deactivate, ? (widget.iconTheme?.iconSelectedColor ??
); theme.primaryIconTheme.color)
}, : (widget.iconTheme?.iconUnselectedColor ?? theme.iconTheme.color),
child: Tooltip(
key: _toolTipKey,
message: 'Please first select some text to transform into a link.'.i18n,
child: QuillIconButton(
highlightElevation: 0,
hoverElevation: 0,
size: widget.iconSize * kIconButtonFactor,
icon: Icon(
widget.icon ?? Icons.link,
size: widget.iconSize,
color: isToggled
? (widget.iconTheme?.iconSelectedColor ??
theme.primaryIconTheme.color)
: (widget.iconTheme?.iconUnselectedColor ??
theme.iconTheme.color),
),
fillColor: isToggled
? (widget.iconTheme?.iconSelectedFillColor ??
theme.toggleableActiveColor)
: (widget.iconTheme?.iconUnselectedFillColor ??
theme.canvasColor),
borderRadius: widget.iconTheme?.borderRadius ?? 2,
onPressed: pressedHandler,
),
), ),
fillColor: isToggled
? (widget.iconTheme?.iconSelectedFillColor ??
theme.toggleableActiveColor)
: (widget.iconTheme?.iconUnselectedFillColor ?? theme.canvasColor),
borderRadius: widget.iconTheme?.borderRadius ?? 2,
onPressed: pressedHandler,
); );
} }

Loading…
Cancel
Save