Skip to content

Commit c0a1064

Browse files
chrisbobbegnprice
authored andcommitted
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
1 parent 3b95070 commit c0a1064

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/widgets/compose_box.dart

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -761,12 +761,15 @@ class _SendButtonState extends State<_SendButton> {
761761
),
762762
child: IconButton(
763763
tooltip: zulipLocalizations.composeBoxSendTooltip,
764-
765-
// Match the height of the content input. Zeroing the padding lets the
766-
// constraints take over.
767-
constraints: const BoxConstraints(minWidth: _sendButtonSize, minHeight: _sendButtonSize),
768-
padding: const EdgeInsets.all(0),
769-
764+
style: const ButtonStyle(
765+
// Match the height of the content input.
766+
minimumSize: MaterialStatePropertyAll(Size.square(_sendButtonSize)),
767+
// With the default of [MaterialTapTargetSize.padded], not just the
768+
// tap target but the visual button would get padded to 48px square.
769+
// It would be nice if the tap target extended invisibly out from the
770+
// button, to make a 48px square, but that's not the behavior we get.
771+
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
772+
),
770773
color: foregroundColor,
771774
icon: const Icon(Icons.send),
772775
onPressed: _send));

0 commit comments

Comments
 (0)