mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 12:12:53 +00:00
LibHTML: Respect the system theme
LibHTML will now use the palette colors for the default document background and the text. As always, a page can override this default styling with CSS if it really wants a specific color or style. Fixes https://github.com/SerenityOS/serenity/issues/963
This commit is contained in:
parent
7557251fac
commit
0f42908073
Notes:
sideshowbarker
2024-07-19 10:21:02 +09:00
Author: https://github.com/bugaevc
Commit: 0f42908073
Pull-request: https://github.com/SerenityOS/serenity/pull/1019
5 changed files with 14 additions and 10 deletions
|
@ -38,7 +38,7 @@ HtmlView::HtmlView(GWidget* parent)
|
|||
set_frame_shadow(FrameShadow::Sunken);
|
||||
set_frame_thickness(2);
|
||||
set_should_hide_unnecessary_scrollbars(true);
|
||||
set_background_color(Color::White);
|
||||
set_background_role(ColorRole::Base);
|
||||
}
|
||||
|
||||
HtmlView::~HtmlView()
|
||||
|
@ -122,7 +122,7 @@ void HtmlView::paint_event(GPaintEvent& event)
|
|||
return;
|
||||
}
|
||||
|
||||
painter.fill_rect(event.rect(), document()->background_color());
|
||||
painter.fill_rect(event.rect(), document()->background_color(palette()));
|
||||
|
||||
if (auto background_bitmap = document()->background_image()) {
|
||||
painter.draw_tiled_bitmap(event.rect(), *background_bitmap);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue