diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index 889ba3fbe..fd558c68c 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -66,7 +66,7 @@ class _PeerCardState extends State<_PeerCard> final name = '${peer.username}${peer.username.isNotEmpty && peer.hostname.isNotEmpty ? '@' : ''}${peer.hostname}'; final PeerTabModel peerTabModel = Provider.of(context); - return Card( + final child = Card( margin: EdgeInsets.symmetric(horizontal: 2), child: GestureDetector( onTap: () { @@ -115,6 +115,23 @@ class _PeerCardState extends State<_PeerCard> ], ), ))); + final colors = _frontN(peer.tags, 25).map((e) => str2color2(e)).toList(); + return Tooltip( + message: peer.tags.isNotEmpty + ? '${translate('Tags')}: ${peer.tags.join(', ')}' + : '', + child: Stack(children: [ + child, + if (colors.isNotEmpty) + Positioned( + top: 2, + right: 10, + child: CustomPaint( + painter: TagPainter(radius: 3, colors: colors), + ), + ) + ]), + ); } Widget _buildDesktop() { diff --git a/flutter/lib/common/widgets/peers_view.dart b/flutter/lib/common/widgets/peers_view.dart index b4fd8e1d4..0e4898fc2 100644 --- a/flutter/lib/common/widgets/peers_view.dart +++ b/flutter/lib/common/widgets/peers_view.dart @@ -421,15 +421,12 @@ class AddressBookPeersView extends BasePeersView { if (selectedTags.isEmpty) { return true; } - if (idents.isEmpty) { - return false; - } for (final tag in selectedTags) { - if (!idents.contains(tag)) { - return false; + if (idents.contains(tag)) { + return true; } } - return true; + return false; } }