Add optional SMAZ compression indicator icon on messages

This commit is contained in:
zjs81 committed 2026-11-21 04:10:43 -07:00
1 parent ae967ec21f
commit d76d488e45
36 files changed
+1321 -38

No files matched your search

+23
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import '../l10n/l10n.dart';
import '../theme/mesh_theme.dart';
/// Colours shared by the direct-message and channel chat bubbles.
@@ -149,3 +150,25 @@ class MessageBubbleFrame extends StatelessWidget {
);
}
}
/// Subtle indicator shown in a message bubble's metadata row when SMAZ
/// compression was applied to the message.
class CompressionIndicator extends StatelessWidget {
final double size;
final Color color;
const CompressionIndicator({super.key, this.size = 14, required this.color});
@override
Widget build(BuildContext context) {
final label = context.l10n.messageMeta_smazCompressed;
return Tooltip(
message: label,
triggerMode: TooltipTriggerMode.tap,
child: Semantics(
label: label,
child: Icon(Icons.compress, size: size, color: color),
),
);
}
}