Merge branch 'krille/colors' into 'main'

chore: Follow up color fixes

See merge request famedly/fluffychat!888
This commit is contained in:
Krille Fear 2022-05-27 13:34:45 +00:00
commit 708999c59d
3 changed files with 20 additions and 15 deletions

View File

@ -213,7 +213,7 @@ class Message extends StatelessWidget {
vertical: 4.0 * vertical: 4.0 *
AppConfig.bubbleSizeFactor), AppConfig.bubbleSizeFactor),
child: ReplyContent(replyEvent, child: ReplyContent(replyEvent,
lightText: ownMessage, ownMessage: ownMessage,
timeline: timeline), timeline: timeline),
), ),
), ),

View File

@ -9,12 +9,12 @@ import 'html_message.dart';
class ReplyContent extends StatelessWidget { class ReplyContent extends StatelessWidget {
final Event replyEvent; final Event replyEvent;
final bool lightText; final bool ownMessage;
final Timeline? timeline; final Timeline? timeline;
const ReplyContent( const ReplyContent(
this.replyEvent, { this.replyEvent, {
this.lightText = false, this.ownMessage = false,
Key? key, Key? key,
this.timeline, this.timeline,
}) : super(key: key); }) : super(key: key);
@ -41,9 +41,9 @@ class ReplyContent extends StatelessWidget {
replyBody = HtmlMessage( replyBody = HtmlMessage(
html: html!, html: html!,
defaultTextStyle: TextStyle( defaultTextStyle: TextStyle(
color: lightText color: ownMessage
? Colors.white ? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).textTheme.bodyText2!.color, : Theme.of(context).colorScheme.onBackground,
fontSize: fontSize, fontSize: fontSize,
), ),
maxLines: 1, maxLines: 1,
@ -60,9 +60,9 @@ class ReplyContent extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
color: lightText color: ownMessage
? Colors.white ? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).textTheme.bodyText2!.color, : Theme.of(context).colorScheme.onBackground,
fontSize: fontSize, fontSize: fontSize,
), ),
); );
@ -73,7 +73,9 @@ class ReplyContent extends StatelessWidget {
Container( Container(
width: 3, width: 3,
height: fontSize * 2 + 6, height: fontSize * 2 + 6,
color: lightText ? Colors.white : Theme.of(context).primaryColor, color: ownMessage
? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).colorScheme.onBackground,
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
Flexible( Flexible(
@ -87,8 +89,9 @@ class ReplyContent extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: color: ownMessage
lightText ? Colors.white : Theme.of(context).primaryColor, ? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).colorScheme.onBackground,
fontSize: fontSize, fontSize: fontSize,
), ),
), ),

View File

@ -35,15 +35,17 @@ class UnreadBadgeBackButton extends StatelessWidget {
padding: const EdgeInsets.all(4), padding: const EdgeInsets.all(4),
margin: const EdgeInsets.only(bottom: 4, right: 8), margin: const EdgeInsets.only(bottom: 4, right: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: borderRadius:
BorderRadius.circular(AppConfig.borderRadius), BorderRadius.circular(AppConfig.borderRadius),
), ),
child: Text( child: Text(
'$unreadCount', '$unreadCount',
style: const TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Colors.white, color: Theme.of(context)
.colorScheme
.onPrimaryContainer,
), ),
), ),
), ),