Skip to content
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

[Cupertino] Exclude border for last action item in CupertinoContextMenu #92481

Merged
merged 5 commits into from
Nov 3, 2021

Conversation

TahaTesser
Copy link
Member

@TahaTesser TahaTesser commented Oct 26, 2021

Description

fixes #92182

Fixes last CupertinoContextMenu action item getting extra border

This problem surfaced when fixing #43211, the last divider more clearly visible in dark mode

Preview

Screenshot 2021-10-29 at 5 31 47 PM

Of course, CupertinoContextMenu appearance isn't exactly like native iOS. but that's unrelated to this PR. See #92260 for more details.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added a: text input Entering text in a text field or keyboard related problems f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. labels Oct 26, 2021
@google-cla google-cla bot added the cla: yes label Oct 26, 2021
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 like a good change just some feedback about small-stuff.

// The scale of the child at the time that the CupertinoContextMenu opens.
// This value was eyeballed from a physical device running iOS 13.1.2.
const double _kOpenScale = 1.1;

// static const Color _kBackgroundColorPressed = Color(0xFFDDDDDD);
const Color _kBackgroundColorPressed = CupertinoDynamicColor.withBrightness(
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming that the darkColor is correct - this looks like a good additional change. This PR's description and a regression test should cover this change.

Copy link
Member

Choose a reason for hiding this comment

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

Did this leak from when you split it out from #92480?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I wanted this to be merged after #92480 since border color also changes with the theme. Only reason I found out we've extra border because of the dark theme PR

packages/flutter/lib/src/cupertino/context_menu.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/cupertino/context_menu.dart Outdated Show resolved Hide resolved
packages/flutter/test/cupertino/context_menu_test.dart Outdated Show resolved Hide resolved
packages/flutter/test/cupertino/context_menu_test.dart Outdated Show resolved Hide resolved
packages/flutter/test/cupertino/context_menu_test.dart Outdated Show resolved Hide resolved
packages/flutter/test/cupertino/context_menu_test.dart Outdated Show resolved Hide resolved
packages/flutter/test/cupertino/context_menu_test.dart Outdated Show resolved Hide resolved
@TahaTesser
Copy link
Member Author

@HansMuller
Thanks so much for the reviewer, I have made the request changes and updated the description.

This needs to be merged after #92480 (it includes testing for dark mode)

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

@jmagman
Copy link
Member

jmagman commented Nov 3, 2021

Unfortunately because of #92611 I can't retry the test that failed due to an infra issue.
@TahaTesser would you mind merging an empty commit to kick the tests off again?

$ git commit --allow-empty -m "Kick tests"

@TahaTesser
Copy link
Member Author

@HansMuller
Thanks so much for the feedback, appreciate it,
This looks good to go, Let me know if anything is needed.

@HansMuller HansMuller merged commit a8f67ee into flutter:master Nov 3, 2021
@TahaTesser TahaTesser deleted the fix_contextmenu_divider branch November 4, 2021 07:14
WizzXu pushed a commit to WizzXu/flutter that referenced this pull request Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cupertino] Last item also gets a divider in CupertinoContextMenu
3 participants