Add custom themes, holiday themes, chat backgrounds and holiday animations

- Themes: name + background + accent, derived surfaces/text/bubbles; editor
  with live preview; share codes and .jsonl import/export
- Theme icons: swap tab, send, settings, node avatar and map marker icons for
  named icons or pictures (lossless JPEG XL)
- Chat backgrounds per channel/DM (color or JPEG XL picture with fade);
  themes can set one, optionally for every chat
- Map follows custom themes (panels, accent, tile tint, markers)
- Holiday themes (Halloween, Thanksgiving, Christmas, New Year's) with
  generated backgrounds, icons and map markers; automatic switching from
  17 days before each holiday
- Holiday greeting animations (bats, turkeys, Santa, fireworks) matched
  across all app languages via translation strings
This commit is contained in:
zjs81 committed 2026-10-31 13:43:34 -07:00
1 parent 780183b586
commit 4a574185e8
124 files changed
+12686 -292

No files matched your search

+25 -8
View File
@@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:flutter/material.dart';
import '../l10n/l10n.dart';
import '../theme/mesh_theme.dart';
import '../theme/theme_icons.dart';
class QuickSwitchBar extends StatelessWidget {
final int selectedIndex;
@@ -25,6 +26,10 @@ class QuickSwitchBar extends StatelessWidget {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
final labelStyle = theme.textTheme.labelMedium ?? const TextStyle();
// Custom themes style the bar on map screens like everywhere else; only
// the stock theme uses the fixed high-contrast map palette.
final highContrast =
this.highContrast && !MeshMapTheme.of(context).followsTheme;
final background = highContrast ? MapPalette.panelDark : Colors.transparent;
// The selected icon sits on the primary indicator pill, so it uses
// onPrimary. The label sits below on the bar background, so it must use a
@@ -77,19 +82,28 @@ class QuickSwitchBar extends StatelessWidget {
}),
),
child: NavigationBar(
height: 60,
// Picture icons are drawn larger than plain ones; give them
// room above the labels.
height:
MeshIconTheme.of(context).hasPictureFor(const [
ThemeIconSlot.contacts,
ThemeIconSlot.channels,
ThemeIconSlot.map,
])
? 76
: 60,
selectedIndex: selectedIndex,
onDestinationSelected: onDestinationSelected,
destinations: [
NavigationDestination(
icon: _buildIconWithBadge(
context,
const Icon(Icons.people_outline),
const ThemedIcon(ThemeIconSlot.contacts),
contactsUnreadCount,
),
selectedIcon: _buildIconWithBadge(
context,
const Icon(Icons.people),
const ThemedIcon(ThemeIconSlot.contacts, selected: true),
contactsUnreadCount,
),
label: context.l10n.nav_contacts,
@@ -97,19 +111,22 @@ class QuickSwitchBar extends StatelessWidget {
NavigationDestination(
icon: _buildIconWithBadge(
context,
const Icon(Icons.tag),
const ThemedIcon(ThemeIconSlot.channels),
channelsUnreadCount,
),
selectedIcon: _buildIconWithBadge(
context,
const Icon(Icons.tag),
const ThemedIcon(ThemeIconSlot.channels, selected: true),
channelsUnreadCount,
),
label: context.l10n.nav_channels,
),
NavigationDestination(
icon: const Icon(Icons.map_outlined),
selectedIcon: const Icon(Icons.map),
icon: const ThemedIcon(ThemeIconSlot.map),
selectedIcon: const ThemedIcon(
ThemeIconSlot.map,
selected: true,
),
label: context.l10n.nav_map,
),
],
@@ -121,7 +138,7 @@ class QuickSwitchBar extends StatelessWidget {
);
}
Widget _buildIconWithBadge(BuildContext context, Icon icon, int count) {
Widget _buildIconWithBadge(BuildContext context, Widget icon, int count) {
if (count <= 0) return icon;
final label = count > 99 ? '99+' : '$count';
return Badge(label: Text(label), child: icon);