Format
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2021-08-26 14:56:58 -07:00
parent 825fb23992
commit 6210a64315
2 changed files with 49 additions and 40 deletions

View File

@ -96,15 +96,17 @@ class _ContactsViewState extends State<ContactsView> {
), ),
body: showSearchBar || Provider.of<ContactListState>(context).isFiltered ? _buildFilterable() : _buildContactList()); body: showSearchBar || Provider.of<ContactListState>(context).isFiltered ? _buildFilterable() : _buildContactList());
} }
List<Widget> getActions(context) { List<Widget> getActions(context) {
var actions = List<Widget>.empty(growable: true); var actions = List<Widget>.empty(growable: true);
if (Provider.of<Settings>(context).blockUnknownConnections ) { if (Provider.of<Settings>(context).blockUnknownConnections) {
actions.add(Tooltip(message: AppLocalizations.of(context)!.blockUnknownConnectionsEnabledDescription, child: Icon(CwtchIcons.block_unknown))); actions.add(Tooltip(message: AppLocalizations.of(context)!.blockUnknownConnectionsEnabledDescription, child: Icon(CwtchIcons.block_unknown)));
} }
actions.add( IconButton(icon: TorIcon(), onPressed: _pushTorStatus),); actions.add(
IconButton(icon: TorIcon(), onPressed: _pushTorStatus),
);
actions.add(IconButton( actions.add(IconButton(
// need both conditions for displaying initial empty textfield and also allowing filters to be cleared if this widget gets lost/reset // need both conditions for displaying initial empty textfield and also allowing filters to be cleared if this widget gets lost/reset
icon: Icon(showSearchBar || Provider.of<ContactListState>(context).isFiltered ? Icons.search_off : Icons.search), icon: Icon(showSearchBar || Provider.of<ContactListState>(context).isFiltered ? Icons.search_off : Icons.search),
onPressed: () { onPressed: () {
Provider.of<ContactListState>(context, listen: false).filter = ""; Provider.of<ContactListState>(context, listen: false).filter = "";

View File

@ -78,9 +78,13 @@ class _MessageViewState extends State<MessageView> {
return WillPopScope( return WillPopScope(
onWillPop: _onWillPop, onWillPop: _onWillPop,
child: Scaffold( child: Scaffold(
floatingActionButton: appState.unreadMessagesBelow ? FloatingActionButton(child: Icon(Icons.arrow_downward), onPressed: (){ floatingActionButton: appState.unreadMessagesBelow
scrollController.scrollTo(index: 0, duration: Duration(milliseconds: 600)); ? FloatingActionButton(
}) : null, child: Icon(Icons.arrow_downward),
onPressed: () {
scrollController.scrollTo(index: 0, duration: Duration(milliseconds: 600));
})
: null,
appBar: AppBar( appBar: AppBar(
// setting leading to null makes it do the default behaviour; container() hides it // setting leading to null makes it do the default behaviour; container() hides it
leading: Provider.of<Settings>(context).uiColumns(appState.isLandscape(context)).length > 1 ? Container() : null, leading: Provider.of<Settings>(context).uiColumns(appState.isLandscape(context)).length > 1 ? Container() : null,
@ -106,9 +110,11 @@ class _MessageViewState extends State<MessageView> {
//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( IconButton(
icon: Icon(CwtchIcons.send_invite, size: 24), icon: Icon(CwtchIcons.send_invite, size: 24),
tooltip: AppLocalizations.of(context)!.sendInvite, tooltip: AppLocalizations.of(context)!.sendInvite,
onPressed: (){_modalSendInvitation(context);}), 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,
@ -204,36 +210,37 @@ class _MessageViewState extends State<MessageView> {
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
decoration: BoxDecoration(border: Border(top: BorderSide(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor()))), decoration: BoxDecoration(border: Border(top: BorderSide(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor()))),
child: RawKeyboardListener( child: RawKeyboardListener(
focusNode: FocusNode(), focusNode: FocusNode(),
onKey: handleKeyPress, onKey: handleKeyPress,
child: Padding( child: Padding(
padding: EdgeInsets.all(8), child:TextFormField( padding: EdgeInsets.all(8),
key: Key('txtCompose'), 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,
enableIMEPersonalizedLearning: false, keyboardType: TextInputType.multiline,
minLines: 1, enableIMEPersonalizedLearning: false,
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,
suffixIcon: ElevatedButton( enabled: true,
style: ElevatedButton.styleFrom(primary: Provider.of<Settings>(context).theme.defaultButtonColor()), suffixIcon: ElevatedButton(
child: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()), style: ElevatedButton.styleFrom(primary: Provider.of<Settings>(context).theme.defaultButtonColor()),
onPressed: isOffline ? null : _sendMessage, child: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
))), onPressed: isOffline ? null : _sendMessage,
)))), ))),
)))),
], ],
), ),
); );