chore: Follow up listtilehover

This commit is contained in:
Krille 2024-07-15 16:57:19 +02:00
commit 54ba4544af
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -103,7 +103,8 @@ class ChatListItem extends StatelessWidget {
color: backgroundColor, color: backgroundColor,
child: FutureBuilder( child: FutureBuilder(
future: room.loadHeroUsers(), future: room.loadHeroUsers(),
builder: (context, snapshot) => ListTile( builder: (context, snapshot) => HoverBuilder(
builder: (context, listTileHovered) => ListTile(
visualDensity: const VisualDensity(vertical: -0.5), visualDensity: const VisualDensity(vertical: -0.5),
contentPadding: const EdgeInsets.symmetric(horizontal: 8), contentPadding: const EdgeInsets.symmetric(horizontal: 8),
onLongPress: () => onLongPress?.call(context), onLongPress: () => onLongPress?.call(context),
@ -144,8 +145,9 @@ class ChatListItem extends StatelessWidget {
? room.isSpace ? room.isSpace
? BorderSide( ? BorderSide(
width: 0, width: 0,
color: color: Theme.of(context)
Theme.of(context).colorScheme.outline, .colorScheme
.outline,
) )
: null : null
: BorderSide( : BorderSide(
@ -168,7 +170,7 @@ class ChatListItem extends StatelessWidget {
onTap: () => onLongPress?.call(context), onTap: () => onLongPress?.call(context),
), ),
), ),
if (hovered) if (listTileHovered)
Positioned( Positioned(
top: -2, top: -2,
right: -2, right: -2,
@ -299,7 +301,8 @@ class ChatListItem extends StatelessWidget {
room.lastEvent?.senderId), room.lastEvent?.senderId),
) )
: null, : null,
initialData: lastEvent?.calcLocalizedBodyFallback( initialData:
lastEvent?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!), MatrixLocals(L10n.of(context)!),
hideReply: true, hideReply: true,
hideEdit: true, hideEdit: true,
@ -349,7 +352,8 @@ class ChatListItem extends StatelessWidget {
: hasNotifications || room.markedUnread : hasNotifications || room.markedUnread
? theme.colorScheme.primary ? theme.colorScheme.primary
: theme.colorScheme.primaryContainer, : theme.colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(AppConfig.borderRadius), borderRadius:
BorderRadius.circular(AppConfig.borderRadius),
), ),
child: Center( child: Center(
child: hasNotifications child: hasNotifications
@ -379,6 +383,7 @@ class ChatListItem extends StatelessWidget {
), ),
), ),
), ),
),
); );
} }
} }