Merge pull request #681 from zjs81/fix/visual-consistency
Fix stale map labels, avatar initials and offline bubble widths
This commit is contained in:
12 files changed
+758
-62
No files matched your search
@@ -1490,21 +1490,25 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
||||
),
|
||||
if (enableTracing &&
|
||||
!isOutgoing &&
|
||||
message.repeatCount > 0) ...[
|
||||
const SizedBox(width: 2),
|
||||
Icon(
|
||||
Icons.repeat,
|
||||
size: 14 * textScale,
|
||||
color: metaColor,
|
||||
message.repeatCount > 0)
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.repeat,
|
||||
size: 14 * textScale,
|
||||
color: metaColor,
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
'${message.repeatCount}',
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 12 * textScale,
|
||||
color: metaColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'${message.repeatCount}',
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 12 * textScale,
|
||||
color: metaColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
if (isOutgoing)
|
||||
MessageStatusIcon(
|
||||
size: 16 * textScale,
|
||||
@@ -4024,8 +4028,10 @@ class _SwipeReplyBubbleState extends State<_SwipeReplyBubble> {
|
||||
onPointerMove: _handleSwipePointerMove,
|
||||
onPointerUp: (event) => _handleSwipePointerUp(event.position),
|
||||
onPointerCancel: (_) => _resetSwipe(),
|
||||
// Same insets as the plain row in _buildMessageBubble, so a bubble is
|
||||
// as wide whether or not it can be swiped (offline, desktop, outgoing).
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(vertical: 3),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
||||
@@ -21,6 +21,7 @@ import '../models/display_path.dart';
|
||||
import '../models/path_playback.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../widgets/adaptive_app_bar_title.dart';
|
||||
import '../widgets/contact_visuals.dart';
|
||||
import '../widgets/mesh_ui.dart';
|
||||
import '../widgets/path_map_scaffold.dart';
|
||||
import '../widgets/path_map_ui.dart';
|
||||
@@ -356,7 +357,7 @@ class ChannelMessagePathScreen extends StatelessWidget {
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
AvatarCircle(name: hop.displayLabel, size: 36),
|
||||
AvatarCircle(name: hop.avatarName, size: 36),
|
||||
Positioned(
|
||||
right: -4,
|
||||
top: -4,
|
||||
@@ -1616,14 +1617,23 @@ class _PathHop {
|
||||
|
||||
bool get hasLocation => position != null;
|
||||
|
||||
String get displayLabel {
|
||||
final prefixLabel = hopBytes != null && hopBytes!.isNotEmpty
|
||||
? hopBytes!
|
||||
.map((b) => b.toRadixString(16).padLeft(2, '0'))
|
||||
.join('')
|
||||
.toUpperCase()
|
||||
: _formatPrefix(prefix);
|
||||
return '($prefixLabel) ${_resolveName(contact, l10n)}';
|
||||
String get prefixLabel => hopBytes != null && hopBytes!.isNotEmpty
|
||||
? hopBytes!
|
||||
.map((b) => b.toRadixString(16).padLeft(2, '0'))
|
||||
.join('')
|
||||
.toUpperCase()
|
||||
: _formatPrefix(prefix);
|
||||
|
||||
String get displayLabel => '($prefixLabel) ${_resolveName(contact, l10n)}';
|
||||
|
||||
/// Avatar source: the repeater's own name, or the hop's hex prefix when
|
||||
/// the hop is unresolved or its name has nothing to make initials from.
|
||||
String get avatarName {
|
||||
final name = contact?.name.trim() ?? '';
|
||||
if (name.toLowerCase() == 'unknown' || avatarInitials(name) == null) {
|
||||
return prefixLabel;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1198,6 +1198,9 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
showOtherNodes: settings.mapShowOtherNodes,
|
||||
isBuildingPathTrace: _isBuildingPathTrace,
|
||||
clusterNodes: settings.mapClusterNodes,
|
||||
// Node labels bake in the overlay colors, so a light/dark or theme
|
||||
// switch must rebuild them.
|
||||
colorScheme: Theme.of(context).colorScheme,
|
||||
);
|
||||
if (key != _nodeMarkersCacheKey) {
|
||||
_nodeMarkersCacheKey = key;
|
||||
@@ -4389,6 +4392,7 @@ class _NodeMarkersCacheKey {
|
||||
final bool showOtherNodes;
|
||||
final bool isBuildingPathTrace;
|
||||
final bool clusterNodes;
|
||||
final ColorScheme colorScheme;
|
||||
|
||||
const _NodeMarkersCacheKey({
|
||||
required this.contactsSignature,
|
||||
@@ -4409,6 +4413,7 @@ class _NodeMarkersCacheKey {
|
||||
required this.showOtherNodes,
|
||||
required this.isBuildingPathTrace,
|
||||
required this.clusterNodes,
|
||||
required this.colorScheme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -4431,7 +4436,8 @@ class _NodeMarkersCacheKey {
|
||||
showChatNodes == other.showChatNodes &&
|
||||
showOtherNodes == other.showOtherNodes &&
|
||||
isBuildingPathTrace == other.isBuildingPathTrace &&
|
||||
clusterNodes == other.clusterNodes;
|
||||
clusterNodes == other.clusterNodes &&
|
||||
colorScheme == other.colorScheme;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -4454,6 +4460,7 @@ class _NodeMarkersCacheKey {
|
||||
showOtherNodes,
|
||||
isBuildingPathTrace,
|
||||
clusterNodes,
|
||||
colorScheme,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user