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

ShouldUseDarkColorsAsync always returns False #32

Open
markatosi opened this issue Dec 28, 2024 · 0 comments
Open

ShouldUseDarkColorsAsync always returns False #32

markatosi opened this issue Dec 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@markatosi
Copy link

markatosi commented Dec 28, 2024

  • Version: 33.2.0.53881
  • Target: .net 9.0 MacOS 15.2
public static class ThemeService
{
   public static void InitializeThemeListener()
    {
        var nativeTheme = Electron.NativeTheme;

        nativeTheme.Updated += async () =>
        {
            var isDarkMode = await nativeTheme.ShouldUseDarkColorsAsync();
            Console.WriteLine(isDarkMode
                ? $"OS theme changed. Dark Mode: {isDarkMode}"
                : $"OS theme changed. Light Mode: {isDarkMode}");
        };
    }
}

The listener is triggered appropriately when I change the default theme on macOS Sequoia.
Am I misunderstanding how to check for OS initiated theme changes?

@markatosi markatosi added the bug Something isn't working label Dec 28, 2024
@markatosi markatosi reopened this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant