Made menus render full color - #779
Merged
Merged
Conversation
stackotter
previously approved these changes
Sep 16, 2026
stackotter
left a comment
Collaborator
There was a problem hiding this comment.
The code looks good, and this fix appears to work basically as could as I would've hoped in practice! I think I misunderstood you when we were talking about this on Discord, cause I don't see anything wrong with this way of doing things (other than not making the hover color have correct contrast for custom colors, but that's a tiny issue imo). I think I hadn't realized that you had found a way to disable vibrancy for arbitrary colors
Collaborator
|
Happy to merge once this PR is updated to get the fixed CI from main |
Collaborator
|
Oh no, a conflict has appeared 😅 |
stackotter
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #777
NSMenuItems (the popup things of Picker and Menu) now render their full color, overriding appkit’s vibrancy stuff.
An exception are Text() in Menu, but that isn’t caused by vibrancy but the lack of an action, since in reality it’s just a button.
The benefit: it renders exactly like appkit normally would and supports colorScheme overrides. And it matches Menu buttons
The caveat: overriding the color doesn’t adapt just like the default, but that’s in the user’s hands.
The reasons: Using a non-adaptive NSColor makes AppKit apply vibrancy stuff, which makes our supplied white grey-ish.
Pretending to be adaptive with the environment dictated color makes the color render correctly, but in light mode it doesn’t change anymore for highlighted, which it does in appkit.
Therefore I decided to use .textColor if
suggestedForegroundColormatches the colorscheme’s default and vibrancyOverride with the requested color for everything else. That way you get the correct behaviour without losing the ability to override it.