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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user