style: Give chat list list tiles rounded corners

krille/update-deps
Krille 3 years ago
parent 5d53a37e2e
commit 7c777c0b7b

@ -127,13 +127,18 @@ class ChatListItem extends StatelessWidget {
final displayname = room.getLocalizedDisplayname( final displayname = room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!), MatrixLocals(L10n.of(context)!),
); );
return Material( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Material(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
clipBehavior: Clip.hardEdge,
color: selected color: selected
? Theme.of(context).colorScheme.primaryContainer ? Theme.of(context).colorScheme.primaryContainer
: activeChat : activeChat
? Theme.of(context).colorScheme.secondaryContainer ? Theme.of(context).colorScheme.secondaryContainer
: Colors.transparent, : Colors.transparent,
child: ListTile( child: ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
onLongPress: onLongPress, onLongPress: onLongPress,
leading: selected leading: selected
? SizedBox( ? SizedBox(
@ -254,7 +259,8 @@ class ChatListItem extends StatelessWidget {
hideEdit: true, hideEdit: true,
plaintextBody: true, plaintextBody: true,
removeMarkdown: true, removeMarkdown: true,
withSenderNamePrefix: !room.isDirectChat || withSenderNamePrefix:
!room.isDirectChat ||
room.directChatMatrixID != room.directChatMatrixID !=
room.lastEvent?.senderId, room.lastEvent?.senderId,
) ?? ) ??
@ -264,8 +270,9 @@ class ChatListItem extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontWeight: unread ? FontWeight.w600 : null, fontWeight: unread ? FontWeight.w600 : null,
color: color: Theme.of(context)
Theme.of(context).colorScheme.onSurfaceVariant, .colorScheme
.onSurfaceVariant,
decoration: room.lastEvent?.redacted == true decoration: room.lastEvent?.redacted == true
? TextDecoration.lineThrough ? TextDecoration.lineThrough
: null, : null,
@ -279,8 +286,9 @@ class ChatListItem extends StatelessWidget {
curve: FluffyThemes.animationCurve, curve: FluffyThemes.animationCurve,
padding: const EdgeInsets.symmetric(horizontal: 7), padding: const EdgeInsets.symmetric(horizontal: 7),
height: unreadBubbleSize, height: unreadBubbleSize,
width: width: room.notificationCount == 0 &&
room.notificationCount == 0 && !unread && !room.hasNewMessages !unread &&
!room.hasNewMessages
? 0 ? 0
: (unreadBubbleSize - 9) * : (unreadBubbleSize - 9) *
room.notificationCount.toString().length + room.notificationCount.toString().length +
@ -316,6 +324,7 @@ class ChatListItem extends StatelessWidget {
), ),
onTap: () => clickAction(context), onTap: () => clickAction(context),
), ),
),
); );
} }
} }

Loading…
Cancel
Save