@@ -20,7 +20,7 @@ import 'store.dart';
20
20
import 'text.dart' ;
21
21
import 'theme.dart' ;
22
22
23
- const double _sendButtonSize = 36 ;
23
+ const double _composeButtonWidth = 44 ;
24
24
25
25
/// A [TextEditingController] for use in the compose box.
26
26
///
@@ -304,7 +304,7 @@ class _ContentInput extends StatelessWidget {
304
304
// [SingleChildScrollView] to insert a fixed-height padding that can
305
305
// be scrolled along with the text.
306
306
child: Padding (
307
- padding: const EdgeInsets .only (top: topPadding),
307
+ padding: const EdgeInsets .only (top: topPadding, left : 16 , right : 16 ),
308
308
child: TextField (
309
309
controller: controller,
310
310
focusNode: focusNode,
@@ -411,17 +411,20 @@ class _TopicInput extends StatelessWidget {
411
411
controller: controller,
412
412
focusNode: focusNode,
413
413
contentFocusNode: contentFocusNode,
414
- fieldViewBuilder: (context) => TextField (
415
- controller: controller,
416
- focusNode: focusNode,
417
- textInputAction: TextInputAction .next,
418
- style: topicTextStyle,
419
- decoration: InputDecoration (
420
- isDense: true ,
421
- border: const UnderlineInputBorder (),
422
- contentPadding: const EdgeInsets .fromLTRB (0 , 10 , 0 , 10 ),
423
- hintStyle: topicTextStyle.copyWith (color: designVariables.textInput.withOpacity (0.5 )),
424
- hintText: zulipLocalizations.composeBoxTopicHintText)));
414
+ fieldViewBuilder: (context) => Padding (
415
+ padding: const EdgeInsets .symmetric (horizontal: 16 ),
416
+ child: TextField (
417
+ controller: controller,
418
+ focusNode: focusNode,
419
+ textInputAction: TextInputAction .next,
420
+ style: topicTextStyle,
421
+ decoration: InputDecoration (
422
+ isDense: true ,
423
+ border: const UnderlineInputBorder (),
424
+ contentPadding: const EdgeInsets .fromLTRB (0 , 10 , 0 , 10 ),
425
+ hintStyle: topicTextStyle.copyWith (color: designVariables.textInput.withOpacity (0.5 )),
426
+ hintText: zulipLocalizations.composeBoxTopicHintText)),
427
+ ));
425
428
}
426
429
}
427
430
@@ -594,10 +597,14 @@ abstract class _AttachUploadsButton extends StatelessWidget {
594
597
@override
595
598
Widget build (BuildContext context) {
596
599
final zulipLocalizations = ZulipLocalizations .of (context);
597
- return IconButton (
598
- icon: Icon (icon),
599
- tooltip: tooltip (zulipLocalizations),
600
- onPressed: () => _handlePress (context));
600
+ return SizedBox (
601
+ width: _composeButtonWidth,
602
+ child: IconButton (
603
+ padding: const EdgeInsets .symmetric (horizontal: 10 ),
604
+ icon: Icon (icon),
605
+ tooltip: tooltip (zulipLocalizations),
606
+ onPressed: () => _handlePress (context)),
607
+ );
601
608
}
602
609
}
603
610
@@ -865,20 +872,14 @@ class _SendButtonState extends State<_SendButton> {
865
872
? designVariables.icon.withOpacity (0.5 )
866
873
: designVariables.icon;
867
874
868
- return IconButton (
869
- tooltip: zulipLocalizations.composeBoxSendTooltip,
870
- style: const ButtonStyle (
871
- // Match the height of the content input.
872
- minimumSize: WidgetStatePropertyAll (Size .square (_sendButtonSize)),
873
- // With the default of [MaterialTapTargetSize.padded], not just the
874
- // tap target but the visual button would get padded to 48px square.
875
- // It would be nice if the tap target extended invisibly out from the
876
- // button, to make a 48px square, but that's not the behavior we get.
877
- tapTargetSize: MaterialTapTargetSize .shrinkWrap,
878
- ),
879
- color: buttonColor,
880
- icon: const Icon (ZulipIcons .send),
881
- onPressed: _send);
875
+ return SizedBox (
876
+ width: _composeButtonWidth,
877
+ child: IconButton (
878
+ tooltip: zulipLocalizations.composeBoxSendTooltip,
879
+ color: buttonColor,
880
+ icon: const Icon (ZulipIcons .send),
881
+ onPressed: _send),
882
+ );
882
883
}
883
884
}
884
885
@@ -898,11 +899,7 @@ class _ComposeBoxContainer extends StatelessWidget {
898
899
border: Border (top: BorderSide (color: designVariables.borderBar))),
899
900
child: Material (
900
901
color: designVariables.bgComposeBox,
901
- child: SafeArea (
902
- child: Padding (
903
- padding: const EdgeInsets .symmetric (horizontal: 16.0 ),
904
- child: child,
905
- )),
902
+ child: SafeArea (child: child),
906
903
));
907
904
}
908
905
}
@@ -924,6 +921,9 @@ class _ComposeBoxLayout extends StatelessWidget {
924
921
925
922
@override
926
923
Widget build (BuildContext context) {
924
+ final themeData = Theme .of (context);
925
+ final designVariables = DesignVariables .of (context);
926
+
927
927
return _ComposeBoxContainer (
928
928
child: Column (children: [
929
929
Row (crossAxisAlignment: CrossAxisAlignment .end, children: [
@@ -933,16 +933,24 @@ class _ComposeBoxLayout extends StatelessWidget {
933
933
contentInput,
934
934
])),
935
935
]),
936
- Row (
937
- mainAxisAlignment: MainAxisAlignment .spaceBetween,
938
- children: [
939
- Row (children: [
940
- _AttachFileButton (contentController: contentController, contentFocusNode: contentFocusNode),
941
- _AttachMediaButton (contentController: contentController, contentFocusNode: contentFocusNode),
942
- _AttachFromCameraButton (contentController: contentController, contentFocusNode: contentFocusNode),
943
- ]),
944
- sendButton,
945
- ],
936
+ Container (
937
+ padding: const EdgeInsets .symmetric (horizontal: 8.0 ),
938
+ height: 42 ,
939
+ child: Row (
940
+ mainAxisAlignment: MainAxisAlignment .spaceBetween,
941
+ children: [
942
+ Theme (
943
+ data: themeData.copyWith (
944
+ iconTheme: themeData.iconTheme.copyWith (color: designVariables.foreground.withOpacity (0.5 ))),
945
+ child: Row (children: [
946
+ _AttachFileButton (contentController: contentController, contentFocusNode: contentFocusNode),
947
+ _AttachMediaButton (contentController: contentController, contentFocusNode: contentFocusNode),
948
+ _AttachFromCameraButton (contentController: contentController, contentFocusNode: contentFocusNode),
949
+ ]),
950
+ ),
951
+ sendButton,
952
+ ],
953
+ ),
946
954
),
947
955
]));
948
956
}
0 commit comments