Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[locker] Keep scanner mode toggle width stable

laurenspriem24cede1c5a1b
diff --git a/mobile/apps/locker/lib/ui/pages/scanner/scanner_capture_page.dart b/mobile/apps/locker/lib/ui/pages/scanner/scanner_capture_page.dart
index b45d881fa2..b1fbb35f57 100644
--- a/mobile/apps/locker/lib/ui/pages/scanner/scanner_capture_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/scanner/scanner_capture_page.dart
@@ -857,6 +857,7 @@ class _AutoToggle extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colors = context.componentColors;
+ final labelStyle = TextStyles.mini.copyWith(color: colors.specialWhite);
return Tooltip(
message: active
? context.strings.scannerAutoCaptureOff
@@ -879,11 +880,21 @@ class _AutoToggle extends StatelessWidget {
size: 20,
),
const SizedBox(width: Spacing.xs),
- Text(
- active
- ? context.strings.scannerCaptureModeAuto
- : context.strings.scannerCaptureModeManual,
- style: TextStyles.mini.copyWith(color: colors.specialWhite),
+ Stack(
+ alignment: Alignment.center,
+ children: [
+ for (final label in [
+ context.strings.scannerCaptureModeAuto,
+ context.strings.scannerCaptureModeManual,
+ ])
+ Opacity(opacity: 0, child: Text(label, style: labelStyle)),
+ Text(
+ active
+ ? context.strings.scannerCaptureModeAuto
+ : context.strings.scannerCaptureModeManual,
+ style: labelStyle,
+ ),
+ ],
),
],
),