diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 914b2ce237..fb8958d0c8 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -2652,5 +2652,6 @@ "documents": "Documents", "location": "Location", "contact": "Contact", - "file": "File" + "file": "File", + "keyboard": "Keyboard" } \ No newline at end of file diff --git a/lib/pages/chat/chat_emoji_picker.dart b/lib/pages/chat/chat_emoji_picker.dart index 9a025c9c6d..eef35bcb82 100644 --- a/lib/pages/chat/chat_emoji_picker.dart +++ b/lib/pages/chat/chat_emoji_picker.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; - +import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:emoji_picker_flutter/emoji_picker_flutter.dart'; - import 'package:fluffychat/config/themes.dart'; import 'chat.dart'; @@ -14,13 +13,18 @@ class ChatEmojiPicker extends StatelessWidget { return AnimatedContainer( duration: FluffyThemes.animationDuration, curve: FluffyThemes.animationCurve, - height: controller.showEmojiPicker - ? MediaQuery.of(context).size.height / 2 - : 0, + width: MediaQuery.of(context).size.width, + height: controller.showEmojiPicker ? MediaQuery.of(context).size.height / 3 : 0, child: controller.showEmojiPicker ? EmojiPicker( onEmojiSelected: controller.onEmojiSelected, onBackspacePressed: controller.emojiPickerBackspace, + config: Config( + backspaceColor: Theme.of(context).colorScheme.primary, + bgColor: Theme.of(context).colorScheme.surface, + indicatorColor: Theme.of(context).colorScheme.primary, + iconColorSelected: Theme.of(context).colorScheme.primary, + ), ) : null, ); diff --git a/lib/pages/chat/chat_input_row.dart b/lib/pages/chat/chat_input_row.dart index 23a12ffa7d..b9f33396e9 100644 --- a/lib/pages/chat/chat_input_row.dart +++ b/lib/pages/chat/chat_input_row.dart @@ -169,12 +169,19 @@ class ChatInputRow extends StatelessWidget { child: child, ); }, - child: TwakeIconButton( - paddingAll: controller.inputText.isEmpty ? 5.0: 12, - tooltip: "Emojis", - onPressed: () {print;}, - icon: Icons.tag_faces, - ), + child: !controller.showEmojiPicker + ? TwakeIconButton( + paddingAll: controller.inputText.isEmpty ? 5.0 : 12, + tooltip: L10n.of(context)!.emojis, + onPressed: () => controller.emojiPickerAction(), + icon: Icons.tag_faces, + ) + : TwakeIconButton( + paddingAll: controller.inputText.isEmpty ? 5.0 : 12, + tooltip: L10n.of(context)!.keyboard, + onPressed: () => controller.inputFocus.requestFocus(), + icon: Icons.keyboard, + ), ), ), ), diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index cd89528aae..e28e396d5c 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -269,58 +269,70 @@ class ChatView extends StatelessWidget { if (controller.room!.canSendDefaultMessages && controller.room!.membership == Membership.join) Container( - margin: EdgeInsets.only( - bottom: bottomSheetPadding, - left: bottomSheetPadding, - right: bottomSheetPadding, - ), constraints: const BoxConstraints( maxWidth: FluffyThemes.columnWidth * 2.5, ), alignment: Alignment.center, child: controller.room?.isAbandonedDMRoom == true - ? Row( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - TextButton.icon( - style: TextButton.styleFrom( - padding: const EdgeInsets.all(16), - foregroundColor: Theme.of(context) - .colorScheme - .error, - ), - icon: const Icon( - Icons.archive_outlined, - ), - onPressed: controller.leaveChat, - label: Text( - L10n.of(context)!.leave, - ), - ), - TextButton.icon( - style: TextButton.styleFrom( - padding: const EdgeInsets.all(16), + ? Padding( + padding: EdgeInsets.only( + bottom: bottomSheetPadding, + left: bottomSheetPadding, + right: bottomSheetPadding, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + TextButton.icon( + style: TextButton.styleFrom( + padding: const EdgeInsets.all(16), + foregroundColor: Theme.of(context) + .colorScheme + .error, + ), + icon: const Icon( + Icons.archive_outlined, + ), + onPressed: controller.leaveChat, + label: Text( + L10n.of(context)!.leave, + ), ), - icon: const Icon( - Icons.chat_outlined, + TextButton.icon( + style: TextButton.styleFrom( + padding: const EdgeInsets.all(16), + ), + icon: const Icon( + Icons.chat_outlined, + ), + onPressed: controller.recreateChat, + label: Text( + L10n.of(context)!.reopenChat, + ), ), - onPressed: controller.recreateChat, - label: Text( - L10n.of(context)!.reopenChat, - ), - ), - ], + ], + ), ) : Column( mainAxisSize: MainAxisSize.min, children: [ - const ConnectionStatusHeader(), - ///Currently we can't support reactions - // ReactionsPicker(controller), - ReplyDisplay(controller), - ChatInputRow(controller), + ...[ + const ConnectionStatusHeader(), + // Currently we can't support reactions + // ReactionsPicker(controller), + ReplyDisplay(controller), + ChatInputRow(controller), + ].map( + (widget) => Padding( + padding: EdgeInsets.only( + left: bottomSheetPadding, + right: bottomSheetPadding, + ), + child: widget, + ), + ), + SizedBox(height: bottomSheetPadding), ChatEmojiPicker(controller), ], ), diff --git a/lib/widgets/twake_components/twake_icon_button.dart b/lib/widgets/twake_components/twake_icon_button.dart index 3afa4e810e..502d8efdf9 100644 --- a/lib/widgets/twake_components/twake_icon_button.dart +++ b/lib/widgets/twake_components/twake_icon_button.dart @@ -50,13 +50,16 @@ class TwakeIconButton extends StatelessWidget { message: tooltip, child: Padding( padding: EdgeInsets.all(paddingAll ?? 8.0), - child: icon != null + child: icon != null ? Icon( - icon, - size: size, - fill: fill, - weight: weight) - : imagePath != null ? SvgPicture.asset(imagePath!) : null, + icon, + size: size, + fill: fill, + weight: weight, + ) + : imagePath != null + ? SvgPicture.asset(imagePath!) + : null, ), ), ),