From f42509f710bb8503f13e353665a0e9e2d19cb224 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Mon, 1 Apr 2024 10:32:11 +0200 Subject: [PATCH] design: Adjust some colors in inputbar --- lib/pages/chat/chat_emoji_picker.dart | 5 +-- lib/pages/chat/events/reply_content.dart | 11 ++++-- lib/pages/chat/reactions_picker.dart | 4 +- lib/pages/chat/reply_display.dart | 45 +++++++++++------------ lib/pages/chat/sticker_picker_dialog.dart | 3 +- 5 files changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/pages/chat/chat_emoji_picker.dart b/lib/pages/chat/chat_emoji_picker.dart index 5a10ddce5..28edafcd7 100644 --- a/lib/pages/chat/chat_emoji_picker.dart +++ b/lib/pages/chat/chat_emoji_picker.dart @@ -42,9 +42,8 @@ class ChatEmojiPicker extends StatelessWidget { onBackspacePressed: controller.emojiPickerBackspace, config: Config( backspaceColor: theme.colorScheme.primary, - bgColor: theme.brightness == Brightness.light - ? Colors.white - : Colors.black, + bgColor: + Theme.of(context).colorScheme.onInverseSurface, iconColor: theme.colorScheme.primary.withOpacity(0.5), iconColorSelected: theme.colorScheme.primary, diff --git a/lib/pages/chat/events/reply_content.dart b/lib/pages/chat/events/reply_content.dart index dc47f2542..c4813f585 100644 --- a/lib/pages/chat/events/reply_content.dart +++ b/lib/pages/chat/events/reply_content.dart @@ -10,12 +10,14 @@ class ReplyContent extends StatelessWidget { final Event replyEvent; final bool ownMessage; final Timeline? timeline; + final Color? backgroundColor; const ReplyContent( this.replyEvent, { this.ownMessage = false, super.key, this.timeline, + this.backgroundColor, }); static const BorderRadius borderRadius = BorderRadius.only( @@ -34,10 +36,11 @@ class ReplyContent extends StatelessWidget { : Theme.of(context).colorScheme.primary; return Material( - color: Theme.of(context) - .colorScheme - .background - .withOpacity(ownMessage ? 0.2 : 0.33), + color: backgroundColor ?? + Theme.of(context) + .colorScheme + .background + .withOpacity(ownMessage ? 0.2 : 0.33), borderRadius: borderRadius, child: Row( mainAxisSize: MainAxisSize.min, diff --git a/lib/pages/chat/reactions_picker.dart b/lib/pages/chat/reactions_picker.dart index 6434c9970..7256e00bc 100644 --- a/lib/pages/chat/reactions_picker.dart +++ b/lib/pages/chat/reactions_picker.dart @@ -60,7 +60,7 @@ class ReactionsPicker extends StatelessWidget { Expanded( child: Container( decoration: BoxDecoration( - color: Theme.of(context).secondaryHeaderColor, + color: Theme.of(context).colorScheme.onInverseSurface, borderRadius: const BorderRadius.only( bottomRight: Radius.circular(AppConfig.borderRadius), ), @@ -92,7 +92,7 @@ class ReactionsPicker extends StatelessWidget { width: 36, height: 56, decoration: BoxDecoration( - color: Theme.of(context).secondaryHeaderColor, + color: Theme.of(context).colorScheme.onInverseSurface, shape: BoxShape.circle, ), child: const Icon(Icons.add_outlined), diff --git a/lib/pages/chat/reply_display.dart b/lib/pages/chat/reply_display.dart index 3bb638abc..67bf47c52 100644 --- a/lib/pages/chat/reply_display.dart +++ b/lib/pages/chat/reply_display.dart @@ -21,29 +21,28 @@ class ReplyDisplay extends StatelessWidget { ? 56 : 0, clipBehavior: Clip.hardEdge, - decoration: const BoxDecoration(), - child: Material( - color: Theme.of(context).secondaryHeaderColor, - child: Row( - children: [ - IconButton( - tooltip: L10n.of(context)!.close, - icon: const Icon(Icons.close), - onPressed: controller.cancelReplyEventAction, - ), - Expanded( - child: controller.replyEvent != null - ? ReplyContent( - controller.replyEvent!, - timeline: controller.timeline!, - ) - : _EditContent( - controller.editEvent - ?.getDisplayEvent(controller.timeline!), - ), - ), - ], - ), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.onInverseSurface, + ), + child: Row( + children: [ + IconButton( + tooltip: L10n.of(context)!.close, + icon: const Icon(Icons.close), + onPressed: controller.cancelReplyEventAction, + ), + Expanded( + child: controller.replyEvent != null + ? ReplyContent( + controller.replyEvent!, + timeline: controller.timeline!, + backgroundColor: Colors.transparent, + ) + : _EditContent( + controller.editEvent?.getDisplayEvent(controller.timeline!), + ), + ), + ], ), ); } diff --git a/lib/pages/chat/sticker_picker_dialog.dart b/lib/pages/chat/sticker_picker_dialog.dart index 35d37c97f..c0a6ec76b 100644 --- a/lib/pages/chat/sticker_picker_dialog.dart +++ b/lib/pages/chat/sticker_picker_dialog.dart @@ -100,6 +100,7 @@ class StickerPickerDialogState extends State { }; return Scaffold( + backgroundColor: Theme.of(context).colorScheme.onInverseSurface, body: SizedBox( width: double.maxFinite, child: CustomScrollView( @@ -108,7 +109,7 @@ class StickerPickerDialogState extends State { floating: true, pinned: true, automaticallyImplyLeading: false, - backgroundColor: Theme.of(context).dialogBackgroundColor, + backgroundColor: Colors.transparent, title: SizedBox( height: 42, child: TextField(