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

Fix incorrect sidebar and sidebar item color #484

Merged
merged 98 commits into from
Jan 17, 2024

Conversation

Adrian-Samoticha
Copy link
Member

@Adrian-Samoticha Adrian-Samoticha commented Oct 7, 2023

This PR fixes a bug that caused the sidebar to appear darker than intended and attempts to make the sidebar items mimic the color of macOS’ native sidebar items more closely.

This is what the example app now looks like in light mode with the accent color set to green:

Screenshot 2023-10-07 at 19 48 02

Unfortunately, the colors appear a little off, particularly when the window is placed on top of a dark background. This is because the sidebar is still rendered beneath the sidebar items, which is not the case for native macOS apps. I could not find a solution to this issue.

Also, the color of the sidebar icons has remained the same and will be addressed on a future PR.

Pre-launch Checklist

  • I have incremented the package version as appropriate and updated CHANGELOG.md with my changes
  • I have added/updated relevant documentation
  • I have run "optimize/organize imports" on all changed files
  • I have addressed all analyzer warnings as best I could

@Adrian-Samoticha
Copy link
Member Author

I just noticed that version 2.0.2 has been released which caused some merge conflicts. I’ll resolve those soon.

@GroovinChip
Copy link
Collaborator

@Adrian-Samoticha has an issue been filed for this bug? I'd like to see what it looks like prior to your changes - additionally, is this bug only present in light mode, or dark mode as well?

@Adrian-Samoticha
Copy link
Member Author

@Adrian-Samoticha has an issue been filed for this bug? I'd like to see what it looks like prior to your changes - additionally, is this bug only present in light mode, or dark mode as well?

The sidebar appears darker than it should both in light and dark mode, though it is obviously more noticeable in light mode. The cause is that the CupertinoApp widget is drawing a transparent black rectangle beneath all its child widgets for some reason, and the fix was to wrap that sidebar’s content with a DecoratedBox with backgroundBlendMode: BlendMode.clear.

Here’s a screenshot from #471. This may not be the best image to showcase the effect, but I think the issue is visible:

image

The sidebar appears visibly darker than it would in a native macOS app.

I haven’t seen any issue related to that bug. In fact, I originally only intended to fix the color of the sidebar buttons in this PR, but the incorrect sidebar color was getting in the way of doing that, so I fixed it.

@GroovinChip
Copy link
Collaborator

Gotcha, thanks for the clarification. I'll try to review ASAP.

@Adrian-Samoticha
Copy link
Member Author

Alright, merge conflicts resolved. :)

Copy link
Collaborator

@GroovinChip GroovinChip left a comment

Choose a reason for hiding this comment

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

LGTM

@GroovinChip GroovinChip linked an issue Jan 16, 2024 that may be closed by this pull request
@GroovinChip GroovinChip added this to the General Native Parity milestone Jan 16, 2024
@GroovinChip GroovinChip merged commit ec4a63b into macosui:dev Jan 17, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

wrong PushButton color
2 participants