mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Handle Auto resolution within Page::preferred_color_scheme
Handling this here means we don't have to it within individual callers
This commit is contained in:
parent
a19a6deaa4
commit
e0e00220fe
Notes:
github-actions[bot]
2025-08-04 10:30:40 +00:00
Author: https://github.com/Calme1709
Commit: e0e00220fe
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5517
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/gmta
3 changed files with 9 additions and 9 deletions
|
|
@ -116,7 +116,13 @@ CSSPixelRect Page::web_exposed_screen_area() const
|
|||
|
||||
CSS::PreferredColorScheme Page::preferred_color_scheme() const
|
||||
{
|
||||
return m_client->preferred_color_scheme();
|
||||
auto preferred_color_scheme = m_client->preferred_color_scheme();
|
||||
|
||||
// FIXME: We can't just check for Auto because page().preferred_color_scheme() returns garbage data after startup.
|
||||
if (preferred_color_scheme != CSS::PreferredColorScheme::Dark && preferred_color_scheme != CSS::PreferredColorScheme::Light)
|
||||
preferred_color_scheme = palette().is_dark() ? CSS::PreferredColorScheme::Dark : CSS::PreferredColorScheme::Light;
|
||||
|
||||
return preferred_color_scheme;
|
||||
}
|
||||
|
||||
CSS::PreferredContrast Page::preferred_contrast() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue