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

tint-dimming behind ContentMenu #20

Closed
palmin opened this issue Mar 25, 2018 · 3 comments
Closed

tint-dimming behind ContentMenu #20

palmin opened this issue Mar 25, 2018 · 3 comments

Comments

@palmin
Copy link

palmin commented Mar 25, 2018

This is a very nice implementation and I plan to use it in Working Copy for switching between branches and file modes.

Everything behind ContextMenu is dimmed slightly with the overlay, but I'm trying to also dim the tint using the UIViewTintAdjustmentModeDimmed mechanism. This makes it much clearer that the ContextMenu has focus.

Do you know of some way to inform UIKit that this should happen?

A regular modalPresentationStyle = .popover gives this effect, but I cannot figure out how to achieve this with modalPresentationStyle = .custom.

Being really picky about my development tools I'm still waiting for Swift tooling to mature and ported most of ContextMenu to objective-c. Is this something you would like to get back into the project or would you rather not?

dim

@palmin
Copy link
Author

palmin commented Mar 25, 2018

This was the easiest way for me to ask this question and it is not a issue with ContextMenu as such. Feel free to close the issue without a second thought.

@palmin
Copy link
Author

palmin commented Mar 25, 2018

I found a solution that seems to work.

Setting window.tintAdjustmentMode = UIViewTintAdjustmentModeDimmed when presenting ContextMenu and resetting to window.tintAdjustmentMode = UIViewTintAdjustmentModeNormal when dismissing dims tint colors behind ContextMenu while shown but leaves the one inside ContextMenu normal.

I presume UIKit adjusts tintAdjustmentMode on presented view controllers.

@palmin palmin closed this as completed Mar 25, 2018
@rnystrom
Copy link
Member

@palmin this is awesome! I might add this as a config param then since it looks pretty easy and has a really cool effect!

Sent with GitHawk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants