From c0a10644b78686abf25d9b3b619cebba8e62213d Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Mon, 20 Nov 2023 13:21:52 -0500 Subject: [PATCH] compose: Shrink "send" button to match content-input height, like before M3 The way to get the smaller IconButton height we want has changed. After migrating to Material Design 3, in #380, we have to do this different thing. Fixes: #398 --- lib/widgets/compose_box.dart | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/widgets/compose_box.dart b/lib/widgets/compose_box.dart index 34b2c6d33b..bdb64838f1 100644 --- a/lib/widgets/compose_box.dart +++ b/lib/widgets/compose_box.dart @@ -761,12 +761,15 @@ class _SendButtonState extends State<_SendButton> { ), child: IconButton( tooltip: zulipLocalizations.composeBoxSendTooltip, - - // Match the height of the content input. Zeroing the padding lets the - // constraints take over. - constraints: const BoxConstraints(minWidth: _sendButtonSize, minHeight: _sendButtonSize), - padding: const EdgeInsets.all(0), - + style: const ButtonStyle( + // Match the height of the content input. + minimumSize: MaterialStatePropertyAll(Size.square(_sendButtonSize)), + // With the default of [MaterialTapTargetSize.padded], not just the + // tap target but the visual button would get padded to 48px square. + // It would be nice if the tap target extended invisibly out from the + // button, to make a 48px square, but that's not the behavior we get. + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), color: foregroundColor, icon: const Icon(Icons.send), onPressed: _send));