这是indexloc提供的服务,不要输入任何密码
Skip to content

Automatically scale down Dialog padding for larger text scale factors #58245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 15, 2020

Conversation

clocksmith
Copy link
Contributor

@clocksmith clocksmith commented May 29, 2020

Description

The paddings on the outer edges of dialog content (not between content) should be smaller for larger text scale size. This PR computes a factor for scaling down the padding and applies it to the space between the edge of the dialog and the content inside.

before:
before1
before2

after:
after1
after2

Related Issues

Tests

I added the following tests:
25 padding tests

  • 3 configurations of AlertDialog x 5 textScaleFactors
  • 2 configurations of SimpleDialog x 5 textScaleFactors

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

@fluttergithubbot fluttergithubbot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. work in progress; do not review labels May 29, 2020
@clocksmith clocksmith changed the title [WIP] Automatically scale down Dialog padding for larger text scale factors Automatically scale down Dialog padding for larger text scale factors Jun 9, 2020
@clocksmith clocksmith marked this pull request as ready for review June 9, 2020 20:49
Copy link
Contributor

@rami-a rami-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you include some screenshots comparing old behavior to new behavior?

@@ -11,7 +11,7 @@ import 'package:matcher/matcher.dart';

import '../widgets/semantics_tester.dart';

MaterialApp _buildAppWithDialog(Widget dialog, { ThemeData theme }) {
MaterialApp _buildAppWithDialog(Widget dialog, { ThemeData theme, double textScaleFactor = 1.0}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space here to match other {

Suggested change
MaterialApp _buildAppWithDialog(Widget dialog, { ThemeData theme, double textScaleFactor = 1.0}) {
MaterialApp _buildAppWithDialog(Widget dialog, { ThemeData theme, double textScaleFactor = 1.0 }) {

@clocksmith clocksmith requested a review from HansMuller June 10, 2020 18:05
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine; just suggesting a little factoring.

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fluttergithubbot fluttergithubbot merged commit 6f56ba4 into flutter:master Jul 15, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants