From a4dfed936171025452ee6cf78ae9e2b41ec1da1e Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 3 Jan 2020 14:44:39 +0100 Subject: [PATCH] Fix wrap --- lib/components/list_items/chat_list_item.dart | 6 +++--- lib/components/message_content.dart | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/components/list_items/chat_list_item.dart b/lib/components/list_items/chat_list_item.dart index 337e7ab..9c2bc9e 100644 --- a/lib/components/list_items/chat_list_item.dart +++ b/lib/components/list_items/chat_list_item.dart @@ -33,6 +33,7 @@ class ChatListItem extends StatelessWidget { ChatTime(room.timeCreated).toEventTimeString(), style: TextStyle( color: Color(0xFF555555), + fontSize: 13, ), ), ], @@ -47,13 +48,12 @@ class ChatListItem extends StatelessWidget { : Icon( Icons.notifications_off, color: Colors.grey, - size: 20, + size: 16, ), room.notificationCount > 0 ? Container( - width: 20, + padding: EdgeInsets.symmetric(horizontal: 5), height: 20, - margin: EdgeInsets.only(top: 3), decoration: BoxDecoration( color: room.highlightCount > 0 ? Colors.red diff --git a/lib/components/message_content.dart b/lib/components/message_content.dart index 2c637b6..4993de7 100644 --- a/lib/components/message_content.dart +++ b/lib/components/message_content.dart @@ -87,6 +87,7 @@ class MessageContent extends StatelessWidget { return Text( senderPrefix + event.getBody(), maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, decoration: event.redacted ? TextDecoration.lineThrough : null, @@ -96,6 +97,7 @@ class MessageContent extends StatelessWidget { return Text( "* " + event.getBody(), maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, fontStyle: FontStyle.italic, @@ -106,6 +108,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} has created the chat", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -114,6 +117,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} has changed the chat avatar", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -122,6 +126,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} has changed the chat name to '${event.content['name']}'", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -196,6 +201,7 @@ class MessageContent extends StatelessWidget { return Text( text, maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -204,6 +210,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} has changed the chat topic to '${event.content['topic']}'", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -212,6 +219,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} has changed the power levels of the chat", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -220,6 +228,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} has changed the history visibility of the chat to '${event.content['history_visibility']}'", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -228,6 +237,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} has changed the join rules of the chat to '${event.content['join_rule']}'", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -245,6 +255,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} has changed the canonical alias to: ${event.content['canonical_alias']}", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, ), @@ -253,6 +264,7 @@ class MessageContent extends StatelessWidget { return Text( "${event.sender.calcDisplayname()} sent a ${event.typeKey} event", maxLines: maxLines, + overflow: textOnly ? TextOverflow.ellipsis : null, style: TextStyle( color: textColor, decoration: event.redacted ? TextDecoration.lineThrough : null,