From 321cc07fb8de101ea32d1e977bb0fab6146ee179 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Wed, 5 Feb 2025 19:19:06 +0100 Subject: [PATCH] chore: Follow up bubble color --- lib/pages/chat/chat_event_list.dart | 18 ++++++++++++++++++ lib/pages/chat/events/message.dart | 10 +++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index 21482422c..223b0797d 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -32,6 +32,23 @@ class ChatEventList extends StatelessWidget { ); } + final theme = Theme.of(context); + + const saturation = 0.85; + final colors = theme.brightness == Brightness.light + ? [ + HSLColor.fromColor(theme.colorScheme.tertiary) + .withSaturation(saturation) + .toColor(), + theme.colorScheme.primary, + ] + : [ + HSLColor.fromColor(theme.colorScheme.tertiaryContainer) + .withSaturation(saturation) + .toColor(), + theme.colorScheme.primaryContainer, + ]; + final horizontalPadding = FluffyThemes.isColumnMode(context) ? 8.0 : 0.0; final events = timeline.events.filterByVisibleInGui(); @@ -153,6 +170,7 @@ class ChatEventList extends StatelessWidget { previousEvent: i > 0 ? events[i - 1] : null, wallpaperMode: hasWallpaper, scrollController: controller.scrollController, + colors: colors, ), ); }, diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index 87d23f33f..071b2deca 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -39,6 +39,7 @@ class Message extends StatelessWidget { final void Function()? resetAnimateIn; final bool wallpaperMode; final ScrollController scrollController; + final List colors; const Message( this.event, { @@ -58,6 +59,7 @@ class Message extends StatelessWidget { this.resetAnimateIn, this.wallpaperMode = false, required this.scrollController, + required this.colors, super.key, }); @@ -328,13 +330,7 @@ class Message extends StatelessWidget { ), clipBehavior: Clip.antiAlias, child: BubbleBackground( - colors: [ - theme.brightness == Brightness.light - ? theme.colorScheme.tertiary - : theme.colorScheme - .tertiaryContainer, - color, - ], + colors: colors, ignore: noBubble || !ownMessage, scrollController: scrollController, child: Container(