Skip to content

Commit b47873f

Browse files
committed
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 640caef commit b47873f

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

lib/widgets/compose_box.dart

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -761,12 +761,18 @@ 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. Empirically, setting
766+
// [MaterialTapTargetSize.shrinkWrap] seems necessary to let the size
767+
// be smaller than 48px square (at least without messing with
768+
// [visualDensity]). So do that. It would be nice if the touch target
769+
// extended invisibly out from the button, to make a 48px square,
770+
// but I can't easily check that in the inspector. It might be the
771+
// behavior, from reading docs, but the docs aren't clear enough
772+
// to rely on.
773+
minimumSize: MaterialStatePropertyAll(Size.square(_sendButtonSize)),
774+
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
775+
),
770776
color: foregroundColor,
771777
icon: const Icon(Icons.send),
772778
onPressed: _send));

0 commit comments

Comments
 (0)