Skip to content

fix: [macOS] follow system colors changes - #8630

Merged
MartinZikmund merged 3 commits into
unoplatform:masterfrom
iurycarlos:dev/ICSI/6767-follow-accent-collor-macos
Jul 13, 2022
Merged

MartinZikmund merged 3 commits into
unoplatform:masterfrom
iurycarlos:dev/ICSI/6767-follow-accent-collor-macos

Conversation

@ghost

@ghost ghost commented Apr 26, 2022

Copy link
Copy Markdown

GitHub Issue (If applicable): closes #6767

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Uno Apps were not able to detect custom color changes made by the user.

What is the new behavior?

Now, the app can detect the custom changes using using UISettings.ColorValuesChanged
and retry the colors by UISettings.GetColorValue().

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Valid to know: AppKit doesn't have all UITypes available on uno. So, some are still hardcoded on SystemResources.xaml.

@ghost
ghost self-requested a review April 26, 2022 18:57
@gitpod-io

gitpod-io Bot commented Apr 26, 2022

Copy link
Copy Markdown

@ghost

ghost commented Apr 26, 2022

Copy link
Copy Markdown
Author

Just a comment: the test itself is testing only if the UISettings is giving the system colors itself. As there's not a easy way to simulate the system color changes.

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is looking good! The test is indeed not automatable for now, so validating that we're getting the same values is fine for now.

@ghost

ghost commented May 4, 2022 •

Copy link
Copy Markdown
Author

Getting building errors from CI, but it builds on macOS ( Monterey 12.2.1):

image

Azure macOS / Xamarin version maybe???

@jeromelaban

Copy link
Copy Markdown
Member

Interesting. It's likely that the Xamarin version we're using on CI is not recent enough to get this property. Let's bump it and see what happens.

@jeromelaban

Copy link
Copy Markdown
Member

This is a very curious error, it even fails on net6:

C:\a\1\s\src\Uno.UI.RuntimeTests\Tests\Windows_UI\Given_Color.cs(75,76): error CS0117: 'NSColor' does not contain a definition for 'ControlAccentColor'
``
This is not an error that's coming from the version of VS. I'll pull the branch to test.

@ghost

ghost commented Jun 3, 2022

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

iury and others added 3 commits June 5, 2022 21:43
Follow user custom colors of macOS. Using UISettings.GetColorValue() method to retry the current system colors.
The changes are monitored by UISettings.ColorValuesChanged
Co-authored-by: Jérôme Laban <[email protected]>
@jeromelaban

Copy link
Copy Markdown
Member

I've rebased your PR and removed the unnecessary bump in macOS CI version.

@ghost
ghost requested a review from MartinZikmund July 4, 2022 14:06
@MartinZikmund
MartinZikmund merged commit b862a99 into unoplatform:master Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uno Platform doesn't follow accent colour on macOS

2 participants