From 8cc3501568e410d805fcc0879dda86b6ef17bb64 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Thu, 30 Jun 2022 15:33:23 -0400 Subject: [PATCH] Tweak chat padding & CLEARMSG casing (#90) --- lib/screens/channel/chat/chat.dart | 6 +- .../channel/chat/widgets/chat_bottom_bar.dart | 117 +++++++++--------- .../channel/chat/widgets/chat_message.dart | 4 +- 3 files changed, 63 insertions(+), 64 deletions(-) diff --git a/lib/screens/channel/chat/chat.dart b/lib/screens/channel/chat/chat.dart index 0c3002dd..2b738741 100644 --- a/lib/screens/channel/chat/chat.dart +++ b/lib/screens/channel/chat/chat.dart @@ -114,11 +114,7 @@ class Chat extends StatelessWidget { ), ), ), - if (chatStore.settings.showBottomBar) - Padding( - padding: const EdgeInsets.symmetric(vertical: 5.0), - child: ChatBottomBar(chatStore: chatStore), - ), + if (chatStore.settings.showBottomBar) ChatBottomBar(chatStore: chatStore), AnimatedContainer( curve: Curves.ease, duration: const Duration(milliseconds: 200), diff --git a/lib/screens/channel/chat/widgets/chat_bottom_bar.dart b/lib/screens/channel/chat/widgets/chat_bottom_bar.dart index 6b951c9f..cc03f467 100644 --- a/lib/screens/channel/chat/widgets/chat_bottom_bar.dart +++ b/lib/screens/channel/chat/widgets/chat_bottom_bar.dart @@ -86,67 +86,70 @@ class ChatBottomBar extends StatelessWidget { ), ) ], - Row( - children: [ - IconButton( - icon: Icon(Icons.adaptive.more), - tooltip: 'Chat details', - onPressed: () => showModalBottomSheet( - backgroundColor: Colors.transparent, - isScrollControlled: true, - context: context, - builder: (_) => ChatDetails( - chatDetails: chatStore.chatDetailsStore, - chatStore: chatStore, - userLogin: chatStore.channelName, - ), - ), - ), - if (!chatStore.expandChat && chatStore.settings.chatWidth < 0.3 && MediaQuery.of(context).orientation == Orientation.landscape) + Padding( + padding: const EdgeInsets.symmetric(vertical: 5.0), + child: Row( + children: [ IconButton( - tooltip: 'Send a message', - onPressed: () { - chatStore.expandChat = true; - chatStore.textFieldFocusNode.requestFocus(); - }, - icon: const Icon(Icons.chat), - ) - else - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), - child: TextField( - textInputAction: TextInputAction.send, - focusNode: chatStore.textFieldFocusNode, - minLines: 1, - maxLines: 5, - enabled: chatStore.auth.isLoggedIn ? true : false, - decoration: InputDecoration( - contentPadding: const EdgeInsets.fromLTRB(20.0, 10.0, 0.0, 10.0), - suffixIcon: IconButton( - color: chatStore.assetsStore.showEmoteMenu ? Theme.of(context).colorScheme.secondary : null, - tooltip: 'Emote menu', - icon: const Icon(Icons.emoji_emotions_outlined), - onPressed: () { - FocusScope.of(context).unfocus(); - chatStore.assetsStore.showEmoteMenu = !chatStore.assetsStore.showEmoteMenu; - }, - ), - hintMaxLines: 1, - hintText: chatStore.auth.isLoggedIn ? 'Send a message' : 'Log in to chat', - ), - controller: chatStore.textController, - onSubmitted: chatStore.sendMessage, + icon: Icon(Icons.adaptive.more), + tooltip: 'Chat details', + onPressed: () => showModalBottomSheet( + backgroundColor: Colors.transparent, + isScrollControlled: true, + context: context, + builder: (_) => ChatDetails( + chatDetails: chatStore.chatDetailsStore, + chatStore: chatStore, + userLogin: chatStore.channelName, ), ), ), - if (chatStore.settings.chatWidth >= 0.3 || chatStore.expandChat || MediaQuery.of(context).orientation == Orientation.portrait) - IconButton( - tooltip: 'Send', - icon: const Icon(Icons.send), - onPressed: chatStore.auth.isLoggedIn ? () => chatStore.sendMessage(chatStore.textController.text) : null, - ) - ], + if (!chatStore.expandChat && chatStore.settings.chatWidth < 0.3 && MediaQuery.of(context).orientation == Orientation.landscape) + IconButton( + tooltip: 'Send a message', + onPressed: () { + chatStore.expandChat = true; + chatStore.textFieldFocusNode.requestFocus(); + }, + icon: const Icon(Icons.chat), + ) + else + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), + child: TextField( + textInputAction: TextInputAction.send, + focusNode: chatStore.textFieldFocusNode, + minLines: 1, + maxLines: 5, + enabled: chatStore.auth.isLoggedIn ? true : false, + decoration: InputDecoration( + contentPadding: const EdgeInsets.fromLTRB(20.0, 10.0, 0.0, 10.0), + suffixIcon: IconButton( + color: chatStore.assetsStore.showEmoteMenu ? Theme.of(context).colorScheme.secondary : null, + tooltip: 'Emote menu', + icon: const Icon(Icons.emoji_emotions_outlined), + onPressed: () { + FocusScope.of(context).unfocus(); + chatStore.assetsStore.showEmoteMenu = !chatStore.assetsStore.showEmoteMenu; + }, + ), + hintMaxLines: 1, + hintText: chatStore.auth.isLoggedIn ? 'Send a message' : 'Log in to chat', + ), + controller: chatStore.textController, + onSubmitted: chatStore.sendMessage, + ), + ), + ), + if (chatStore.settings.chatWidth >= 0.3 || chatStore.expandChat || MediaQuery.of(context).orientation == Orientation.portrait) + IconButton( + tooltip: 'Send', + icon: const Icon(Icons.send), + onPressed: chatStore.auth.isLoggedIn ? () => chatStore.sendMessage(chatStore.textController.text) : null, + ) + ], + ), ), ], ); diff --git a/lib/screens/channel/chat/widgets/chat_message.dart b/lib/screens/channel/chat/widgets/chat_message.dart index a74ef44e..cc463fb5 100644 --- a/lib/screens/channel/chat/widgets/chat_message.dart +++ b/lib/screens/channel/chat/widgets/chat_message.dart @@ -87,12 +87,12 @@ class ChatMessage extends StatelessWidget { if (banDuration == null) if (ircMessage.command == Command.clearMessage) const Text( - 'Message Deleted', + 'Message deleted', style: TextStyle(fontWeight: FontWeight.bold), ) else const Text( - 'User Permanently Banned', + 'User permanently banned', style: TextStyle(fontWeight: FontWeight.bold), ) else