Add an interface size setting (0.5x to 2x)

Settings > Appearance > Interface size scales every dimension, text, icon
and dialog on this device. The app lays out in a smaller or larger viewport
and paints it scaled to the window, so hit testing and layout stay
consistent; the value is saved per device and applies when the slider is
released.
This commit is contained in:
2026-11-09 12:56:42 +00:00
parent 701fb98ef0
commit bb2adcc182
9 changed files with 402 additions and 3 deletions
@@ -4,6 +4,8 @@ import 'dart:math' as math;
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../../../ui/scale/ui_scale.dart';
import 'chat_stop_icon.dart';
import 'package:flutter/services.dart';
@@ -1176,9 +1178,9 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
int _maxLines(BuildContext context) {
final media = MediaQuery.of(context);
// The scaffold hides the keyboard from its body; the window still has it.
final keyboard = MediaQueryData.fromView(
View.of(context),
).viewInsets.bottom;
final keyboard =
MediaQueryData.fromView(View.of(context)).viewInsets.bottom /
UiScaleHost.of(context);
final visible = media.size.height - keyboard;
final lineHeight = MediaQuery.textScalerOf(context).scale(22);
final fit = (visible * 0.4 / lineHeight).floor();