nicer compose bar

This commit is contained in:
erinn 2021-08-26 13:52:17 -07:00
parent 65811231a7
commit 61d1a60b0e
1 changed files with 28 additions and 31 deletions

View File

@ -105,6 +105,10 @@ class _MessageViewState extends State<MessageView> {
//IconButton(icon: Icon(Icons.chat), onPressed: _pushContactSettings), //IconButton(icon: Icon(Icons.chat), onPressed: _pushContactSettings),
//IconButton(icon: Icon(Icons.list), onPressed: _pushContactSettings), //IconButton(icon: Icon(Icons.list), onPressed: _pushContactSettings),
//IconButton(icon: Icon(Icons.push_pin), onPressed: _pushContactSettings), //IconButton(icon: Icon(Icons.push_pin), onPressed: _pushContactSettings),
IconButton(
icon: Icon(CwtchIcons.send_invite, size: 24),
tooltip: AppLocalizations.of(context)!.sendInvite,
onPressed: (){_modalSendInvitation(context);}),
IconButton( IconButton(
icon: Provider.of<ContactInfoState>(context, listen: false).isGroup == true ? Icon(CwtchIcons.group_settings_24px) : Icon(CwtchIcons.peer_settings_24px), icon: Provider.of<ContactInfoState>(context, listen: false).isGroup == true ? Icon(CwtchIcons.group_settings_24px) : Icon(CwtchIcons.peer_settings_24px),
tooltip: AppLocalizations.of(context)!.conversationSettings, tooltip: AppLocalizations.of(context)!.conversationSettings,
@ -205,37 +209,30 @@ class _MessageViewState extends State<MessageView> {
child: RawKeyboardListener( child: RawKeyboardListener(
focusNode: FocusNode(), focusNode: FocusNode(),
onKey: handleKeyPress, onKey: handleKeyPress,
child: TextFormField( child: Padding(
key: Key('txtCompose'), padding: EdgeInsets.all(8), child:TextFormField(
controller: ctrlrCompose, key: Key('txtCompose'),
focusNode: focusNode, controller: ctrlrCompose,
autofocus: !Platform.isAndroid, focusNode: focusNode,
textInputAction: TextInputAction.newline, autofocus: !Platform.isAndroid,
keyboardType: TextInputType.multiline, textInputAction: TextInputAction.newline,
minLines: 1, keyboardType: TextInputType.multiline,
maxLines: null, minLines: 1,
onFieldSubmitted: _sendMessage, maxLines: null,
enabled: !isOffline, onFieldSubmitted: _sendMessage,
decoration: InputDecoration( enabled: !isOffline,
hintText: isOffline ? "" : AppLocalizations.of(context)!.placeholderEnterMessage, decoration: InputDecoration(
hintStyle: TextStyle(color: Provider.of<Settings>(context).theme.altTextColor()), hintText: isOffline ? "" : AppLocalizations.of(context)!.placeholderEnterMessage,
enabledBorder: InputBorder.none, hintStyle: TextStyle(color: Provider.of<Settings>(context).theme.altTextColor()),
focusedBorder: InputBorder.none, enabledBorder: InputBorder.none,
enabled: true, focusedBorder: InputBorder.none,
prefixIcon: IconButton( enabled: true,
icon: Icon(CwtchIcons.send_invite, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()), suffixIcon: ElevatedButton(
tooltip: AppLocalizations.of(context)!.sendInvite, style: ElevatedButton.styleFrom(primary: Provider.of<Settings>(context).theme.defaultButtonColor()),
enableFeedback: true, child: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
splashColor: Provider.of<Settings>(context).theme.defaultButtonActiveColor(), onPressed: isOffline ? null : _sendMessage,
hoverColor: Provider.of<Settings>(context).theme.defaultButtonActiveColor(), ))),
onPressed: () => _modalSendInvitation(context)), )))),
suffixIcon: IconButton(
icon: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
tooltip: AppLocalizations.of(context)!.sendMessage,
onPressed: isOffline ? null : _sendMessage,
),
)))),
),
], ],
), ),
); );