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
+20
-5
@@ -34,6 +34,7 @@ import 'services/map_tile_cache_service.dart';
|
||||
import 'services/chat_text_scale_service.dart';
|
||||
import 'services/translation_service.dart';
|
||||
import 'services/ui_view_state_service.dart';
|
||||
import 'services/chat_background_service.dart';
|
||||
import 'services/timeout_prediction_service.dart';
|
||||
import 'storage/prefs_manager.dart';
|
||||
import 'theme/mesh_theme.dart';
|
||||
@@ -86,8 +87,13 @@ void main() async {
|
||||
// `appSettingsService.settings`, so this cannot stay where it used to be
|
||||
// (after the constructions) without those two starting out wrong.
|
||||
await appSettingsService.loadSettings();
|
||||
// Re-check the automatic holiday theme when the date changes.
|
||||
appSettingsService.startDateWatch();
|
||||
// Undo a review-mode session the app was killed in before it could exit.
|
||||
await endReviewModeSession(appSettingsService);
|
||||
final chatBackgroundService = ChatBackgroundService(appSettingsService);
|
||||
// Drop pictures left behind by removed backgrounds or abandoned edits.
|
||||
unawaited(chatBackgroundService.collectGarbage());
|
||||
|
||||
// ---- image messages (AEIC over GRP_DATA) --------------------------------
|
||||
// The codec owns the ONNX decoder; the store owns received-image state and
|
||||
@@ -212,6 +218,7 @@ void main() async {
|
||||
receivedImageStore: receivedImageStore,
|
||||
imageReassembler: imageReassembler,
|
||||
networkMapUploadService: networkMapUploadService,
|
||||
chatBackgroundService: chatBackgroundService,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -357,6 +364,7 @@ class MeshCoreApp extends StatefulWidget {
|
||||
final ReceivedImageStore receivedImageStore;
|
||||
final ImageStreamReassembler imageReassembler;
|
||||
final NetworkMapUploadService networkMapUploadService;
|
||||
final ChatBackgroundService chatBackgroundService;
|
||||
|
||||
const MeshCoreApp({
|
||||
super.key,
|
||||
@@ -376,6 +384,7 @@ class MeshCoreApp extends StatefulWidget {
|
||||
required this.receivedImageStore,
|
||||
required this.imageReassembler,
|
||||
required this.networkMapUploadService,
|
||||
required this.chatBackgroundService,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -468,9 +477,11 @@ class _MeshCoreAppState extends State<MeshCoreApp> with WidgetsBindingObserver {
|
||||
ChangeNotifierProvider.value(value: widget.imageCodecService),
|
||||
ChangeNotifierProvider.value(value: widget.receivedImageStore),
|
||||
ChangeNotifierProvider.value(value: widget.networkMapUploadService),
|
||||
ChangeNotifierProvider.value(value: widget.chatBackgroundService),
|
||||
],
|
||||
child: Consumer<AppSettingsService>(
|
||||
builder: (context, settingsService, child) {
|
||||
final customTheme = settingsService.activeCustomTheme;
|
||||
return MaterialApp(
|
||||
title: 'MeshCore Open',
|
||||
debugShowCheckedModeBanner: false,
|
||||
@@ -484,13 +495,17 @@ class _MeshCoreAppState extends State<MeshCoreApp> with WidgetsBindingObserver {
|
||||
locale: _localeFromSetting(
|
||||
settingsService.settings.languageOverride,
|
||||
),
|
||||
theme: MeshTheme.light(),
|
||||
darkTheme: settingsService.settings.themeMode == 'terminal'
|
||||
theme: customTheme != null
|
||||
? MeshTheme.fromCustom(customTheme)
|
||||
: MeshTheme.light(),
|
||||
darkTheme: customTheme != null
|
||||
? MeshTheme.fromCustom(customTheme)
|
||||
: settingsService.settings.themeMode == 'terminal'
|
||||
? terminalTheme()
|
||||
: MeshTheme.dark(),
|
||||
themeMode: _themeModeFromSetting(
|
||||
settingsService.settings.themeMode,
|
||||
),
|
||||
themeMode: customTheme != null
|
||||
? (customTheme.isDark ? ThemeMode.dark : ThemeMode.light)
|
||||
: _themeModeFromSetting(settingsService.settings.themeMode),
|
||||
builder: (context, child) {
|
||||
// Update notification service with resolved locale
|
||||
final locale = Localizations.localeOf(context);
|
||||
|
||||
Reference in new issue
Block a user