mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Add a signal preference for dynamic color changes to adjust "brighttext" in the front-end.
This makes all relevant toolbars pick up the fact that the Windows accent color has changed and should check and if necessary update the "brighttext" property on them for styling of controls. This is a bit of a hack-around to the fact that there is no real easy way otherwise to notify the front-end of color changes without needing a change in focus of the window. There is a deliberate 300ms delay built in, because otherwise the styles might not have propagated yet, resulting in brighttext not being updated properly.
This commit is contained in:
parent
0ab64f6cfa
commit
2ce8b3b74e
2 changed files with 19 additions and 0 deletions
|
|
@ -7141,8 +7141,10 @@ nsWindow::OnSysColorChanged()
|
|||
NotifySysColorChanged();
|
||||
// On Windows 10 only, we trigger a theme change to pick up changed media
|
||||
// queries that are needed for accent color changes.
|
||||
// We also set a temp pref to notify the FE that the colors have changed.
|
||||
if (IsWin10OrLater()) {
|
||||
NotifyThemeChanged();
|
||||
Preferences::SetBool("ui.colorChanged", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue