From cdaaad9c54632be2a2ca15871ecd2eb5caf51083 Mon Sep 17 00:00:00 2001 From: Krille Date: Sun, 3 Nov 2024 15:07:08 +0100 Subject: [PATCH] chore: Design follow up --- lib/pages/chat/events/message.dart | 23 +++---------------- lib/pages/chat/events/reply_content.dart | 7 +++--- .../chat_details/participant_list_item.dart | 19 +++++++++++---- .../settings_style/settings_style_view.dart | 12 +--------- 4 files changed, 23 insertions(+), 38 deletions(-) diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index a2b40a7c1..46586b13c 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -306,27 +306,10 @@ class Message extends StatelessWidget { curve: FluffyThemes.animationCurve, child: Container( decoration: BoxDecoration( - color: ownMessage - ? null - : noBubble - ? Colors.transparent - : color, + color: noBubble + ? Colors.transparent + : color, borderRadius: borderRadius, - gradient: ownMessage && !noBubble - ? LinearGradient( - colors: [ - theme.colorScheme.primary, - theme.brightness == - Brightness.light - ? theme.colorScheme - .onPrimaryFixedVariant - : theme.colorScheme - .primaryFixed, - ], - begin: Alignment.centerLeft, - end: Alignment.bottomRight, - ) - : null, ), clipBehavior: Clip.antiAlias, child: Container( diff --git a/lib/pages/chat/events/reply_content.dart b/lib/pages/chat/events/reply_content.dart index a3f18efee..c77117264 100644 --- a/lib/pages/chat/events/reply_content.dart +++ b/lib/pages/chat/events/reply_content.dart @@ -34,8 +34,8 @@ class ReplyContent extends StatelessWidget { timeline != null ? replyEvent.getDisplayEvent(timeline) : replyEvent; final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor; final color = ownMessage - ? theme.colorScheme.primaryContainer - : theme.colorScheme.primary; + ? theme.colorScheme.tertiaryContainer + : theme.colorScheme.tertiary; return Material( color: backgroundColor ?? @@ -56,6 +56,7 @@ class ReplyContent extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ FutureBuilder( + initialData: displayEvent.senderFromMemoryOrFallback, future: displayEvent.fetchSenderUser(), builder: (context, snapshot) { return Text( @@ -80,7 +81,7 @@ class ReplyContent extends StatelessWidget { maxLines: 1, style: TextStyle( color: ownMessage - ? theme.colorScheme.onPrimary + ? theme.colorScheme.onTertiary : theme.colorScheme.onSurface, fontSize: fontSize, ), diff --git a/lib/pages/chat_details/participant_list_item.dart b/lib/pages/chat_details/participant_list_item.dart index b71f37310..2be366a7c 100644 --- a/lib/pages/chat_details/participant_list_item.dart +++ b/lib/pages/chat_details/participant_list_item.dart @@ -25,7 +25,7 @@ class ParticipantListItem extends StatelessWidget { Membership.leave => L10n.of(context).leftTheChat, }; - final permissionBatch = user.powerLevel == 100 + final permissionBatch = user.powerLevel >= 100 ? L10n.of(context).admin : user.powerLevel >= 50 ? L10n.of(context).moderator @@ -56,14 +56,20 @@ class ParticipantListItem extends StatelessWidget { vertical: 6, ), decoration: BoxDecoration( - color: theme.colorScheme.primaryContainer, + color: user.powerLevel >= 100 + ? theme.colorScheme.tertiary + : theme.colorScheme.tertiaryContainer, borderRadius: BorderRadius.circular( AppConfig.borderRadius, ), ), child: Text( permissionBatch, - style: TextStyle(color: theme.colorScheme.onPrimaryContainer), + style: theme.textTheme.labelSmall?.copyWith( + color: user.powerLevel >= 100 + ? theme.colorScheme.onTertiary + : theme.colorScheme.onTertiaryContainer, + ), ), ), membershipBatch == null @@ -75,7 +81,12 @@ class ParticipantListItem extends StatelessWidget { color: theme.secondaryHeaderColor, borderRadius: BorderRadius.circular(8), ), - child: Center(child: Text(membershipBatch)), + child: Center( + child: Text( + membershipBatch, + style: theme.textTheme.labelSmall, + ), + ), ), ], ), diff --git a/lib/pages/settings_style/settings_style_view.dart b/lib/pages/settings_style/settings_style_view.dart index 0b73bbc3e..fe5d236b3 100644 --- a/lib/pages/settings_style/settings_style_view.dart +++ b/lib/pages/settings_style/settings_style_view.dart @@ -213,17 +213,7 @@ class SettingsStyleView extends StatelessWidget { ), child: DecoratedBox( decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - theme.colorScheme.primary, - theme.brightness == Brightness.light - ? theme.colorScheme - .onPrimaryFixedVariant - : theme.colorScheme.primaryFixed, - ], - begin: Alignment.centerLeft, - end: Alignment.bottomRight, - ), + color: theme.colorScheme.primary, borderRadius: BorderRadius.circular( AppConfig.borderRadius, ),