Skip to content

Commit

Permalink
compose: Shrink "send" button to match content-input height, like bef…
Browse files Browse the repository at this point in the history
…ore M3

The way to get the smaller IconButton height we want has changed.
After migrating to Material Design 3, in zulip#380, we have to do this
different thing.

Fixes: zulip#398
  • Loading branch information
chrisbobbe authored and gnprice committed Nov 21, 2023
1 parent 3b95070 commit c0a1064
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/widgets/compose_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit c0a1064

Please sign in to comment.