Skip to content

Uno Platform doesn't follow accent colour on macOS #6767

Closed

Description

@jgkumaran

Current behavior

On macOS, SystemAccentColor is set to the hard-coded value - blue instead of using the user's accent colour selected in System Preferences.

Expected behavior

SystemAccentColor should be set to the user's accent colour by default.

Screenshot 2021-08-14 at 12 48 12

Here's an example using NavigationView which doesn't apply the user's accent colour for the selection indicator.

Related to #3555

Activity

  1. added
    difficulty/tbd
    kind/bug
    triage/untriaged
    on Aug 14, 2021
  2. added
    project/styling 👔
    and removed
    triage/untriaged
    on Aug 23, 2021
  3. ghost
    self-assigned this
    on Mar 22, 2022
  4. jeromelaban commented on Mar 31, 2022

    @jeromelaban
    Member

    Can you link to the discussions you found?

  5. jeromelaban commented on Mar 31, 2022

    @jeromelaban
    Member

    Following the accent color would be a good start, then we can figure out how to refresh when the color changes.

  6. jeromelaban commented on Apr 19, 2022

    @jeromelaban
    Member

    We can make this a feature flag if needed. Let's try reading the color when there's a notification and see which color we do get. (Let's try in a sample app first to see what happens)

  7. jeromelaban commented on Apr 20, 2022

    @jeromelaban
    Member

    Good. If you see the colors changing properly with Xamarin.mac, particularly when the theme changes as well, this means we'll be able to integrate it into uno.

  8. jeromelaban commented on Apr 26, 2022

    @jeromelaban
    Member

    That's fine for now, I'd guess. systemColorsDidChangeNotification does not provide proper notifications?

  9. jeromelaban commented on Apr 26, 2022

    @jeromelaban
    Member

    This is what is available in Xamarin.mac:

    // AppKit.NSColor
    using Foundation;
    using ObjCRuntime;
    
    /// <summary>To be added.</summary>
    /// <value>To be added.</value>
    /// <remarks>To be added.</remarks>
    [Field("NSSystemColorsDidChangeNotification", "AppKit")]
    [Advice("Use NSColor.Notifications.ObserveSystemColorsChanged helper method instead.")]
    public static NSString SystemColorsChanged
    {
    	get
    	{
    		if ((object)_SystemColorsChanged == null)
    		{
    			_SystemColorsChanged = Dlfcn.GetStringConstant(ObjCRuntime.Libraries.AppKit.Handle, "NSSystemColorsDidChangeNotification");
    		}
    		return _SystemColorsChanged;
    	}
    }

    of NSColor.Notifications.ObserveSystemColorsChanged

    Have you tried to use this directly to observe color changes ?

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

Metadata

Metadata

Assignees

Labels

difficulty/tbdkind/bugproject/styling 👔

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions