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

Not auto change to System Theme #13

Closed
SiTWulf opened this issue Jul 8, 2024 · 3 comments
Closed

Not auto change to System Theme #13

SiTWulf opened this issue Jul 8, 2024 · 3 comments
Milestone

Comments

@SiTWulf
Copy link

SiTWulf commented Jul 8, 2024

I love all of the new features, and the follow system theme is really a perfect thing, but when I set the new option for Follow System Theme, only change when you enter in Options window.

@brondavies
Copy link
Owner

I'm not sure I understand what the problem is. It seems to be working for me.

@SiTWulf
Copy link
Author

SiTWulf commented Jul 9, 2024

Oh, Sorry.
English is not my native language.

Having windows in Light Theme open Tray ToolBar and in settings select System in Theme, now click Save.
You have Light theme in Windows and in TrayToolBar, but if you change Windows Theme to Dark, TrayToolBar stay in Light Theme until you open TrayToolBar Settings.

@PebcakCity
Copy link

Similarly - at least for me - starting TrayToolbar with the theme set to "System" and Windows already set to dark mode, the context menu does not get its dark theme until the SettingsForm is first shown.

I think maybe it's partially because when the program first starts with an invisible window (SettingsForm.SetVisibleCore is overridden to allow this I guess), the window handle hasn't been created/assigned yet, so SettingsForm_HandleCreated doesn't run and it won't set the dark theme preference until the SettingsForm is actually shown for the first time?

I added 2 lines to the beginning of SetVisibleCore and it seems to make it at least grab the system theme on program startup for me:

protected override void SetVisibleCore(bool value)
{
    if (value && !IsHandleCreated)
        CreateHandle();
    // ...
}

But this doesn't fix the other half of the issue as @SiTWulf described above - If TrayToolbar is already running and the SettingsForm has still not been shown for the first time, changing the Windows theme doesn't appear to change the theme of TrayToolbar's context menu. Not sure why that is ... unless it's because the event handler for theme changing also doesn't run correctly until the form is first shown?

Anyway, thank you for creating this software. It replaces a much-missed Windows feature that I can't stand not having.

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

No branches or pull requests

3 participants