Merge upstream/dev: custom and holiday themes, chat backgrounds
Upstream's theme system (two-color custom themes, holiday themes, picture icons, chat backgrounds) next to the tth terminal theme: - a user's custom theme wins; without one, themeMode 'terminal' is still the dark theme (main.dart); - MeshTheme.buildFrom (terminal base) builds with the stock bubble, icon and map extensions, like dark()/light(); - terminal avatars also show a theme slot's glyph; the bottom bar stays 44 px without labels in the terminal theme, 76/60 otherwise; - map overlays: terminal panels stay square and black, otherwise upstream's palette/follow-theme logic; channel list keeps the terminal padding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
675342e745
144 files changed
+13281
-732
No files matched your search
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../theme/terminal_theme.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
class QuickSwitchBar extends StatelessWidget {
|
||||
final int selectedIndex;
|
||||
@@ -26,6 +27,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
|
||||
@@ -83,7 +88,17 @@ class QuickSwitchBar extends StatelessWidget {
|
||||
}),
|
||||
),
|
||||
child: NavigationBar(
|
||||
height: terminal ? 44 : 60,
|
||||
// Picture icons are drawn larger than plain ones; give them
|
||||
// room above the labels. The tth terminal theme stays compact.
|
||||
height: terminal
|
||||
? 44
|
||||
: MeshIconTheme.of(context).hasPictureFor(const [
|
||||
ThemeIconSlot.contacts,
|
||||
ThemeIconSlot.channels,
|
||||
ThemeIconSlot.map,
|
||||
])
|
||||
? 76
|
||||
: 60,
|
||||
labelBehavior: terminal
|
||||
? NavigationDestinationLabelBehavior.alwaysHide
|
||||
: null,
|
||||
@@ -93,12 +108,12 @@ class QuickSwitchBar extends StatelessWidget {
|
||||
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,
|
||||
@@ -106,19 +121,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,
|
||||
),
|
||||
],
|
||||
@@ -130,7 +148,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);
|
||||
|
||||
Reference in new issue
Block a user