mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
committed by
Andreas Kling
parent
7557251fac
commit
0f42908073
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user