Merge upstream/dev (35 commits) into tth
Conflicts in lib/widgets/mesh_nav_tile.dart and lib/widgets/mesh_ui.dart: took upstream's iconSlot/ThemedIcon, busy spinner and SectionHeader description, and re-applied the terminal theme on top (18 dp icons, narrower gaps and padding, mono section labels). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
ceab62428a
103 files changed
+13328
-5463
No files matched your search
@@ -55,6 +55,17 @@ import '../helpers/utf8_length_limiter.dart';
|
||||
import 'line_of_sight_map_screen.dart';
|
||||
import '../theme/theme_icons.dart';
|
||||
|
||||
const String _lastCameraKey = 'map_last_camera';
|
||||
|
||||
/// The Map tab's last camera, or null if never saved.
|
||||
({LatLng center, double zoom})? savedMapCamera() {
|
||||
final saved = PrefsManager.instance.getStringList(_lastCameraKey);
|
||||
if (saved == null || saved.length != 3) return null;
|
||||
final values = saved.map(double.tryParse).toList();
|
||||
if (values.contains(null)) return null;
|
||||
return (center: LatLng(values[0]!, values[1]!), zoom: values[2]!);
|
||||
}
|
||||
|
||||
class MapScreen extends StatefulWidget {
|
||||
final LatLng? highlightPosition;
|
||||
final String? highlightLabel;
|
||||
@@ -134,7 +145,6 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
// been positioned once.
|
||||
({LatLng center, double zoom})? _initialCamera;
|
||||
|
||||
static const String _lastCameraKey = 'map_last_camera';
|
||||
static const Duration _cameraSaveDelay = Duration(milliseconds: 500);
|
||||
Timer? _cameraSaveTimer;
|
||||
List<String>? _pendingCamera;
|
||||
@@ -145,14 +155,7 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
if (lat != null && lon != null && isPlausibleLocation(lat, lon)) {
|
||||
return (center: LatLng(lat, lon), zoom: 12.0);
|
||||
}
|
||||
final saved = PrefsManager.instance.getStringList(_lastCameraKey);
|
||||
if (saved != null && saved.length == 3) {
|
||||
final values = saved.map(double.tryParse).toList();
|
||||
if (!values.contains(null)) {
|
||||
return (center: LatLng(values[0]!, values[1]!), zoom: values[2]!);
|
||||
}
|
||||
}
|
||||
return (center: const LatLng(20, 0), zoom: _mapMinZoom);
|
||||
return savedMapCamera() ?? (center: const LatLng(20, 0), zoom: _mapMinZoom);
|
||||
}
|
||||
|
||||
void _scheduleCameraSave() {
|
||||
|
||||
Reference in new issue
Block a user