summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/TableView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-18 21:55:37 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-18 21:55:37 +0200
commitd17b42b28df96b409d8309bbe71214713f76a147 (patch)
treeb5456df859af959d8cd7b22c7c050f21436a8d95 /Libraries/LibGUI/TableView.cpp
parentc7b7b653093c40b89a3644d8fb1576a282ac2e00 (diff)
downloadserenity-d17b42b28df96b409d8309bbe71214713f76a147.zip
LibGUI: Make view widgets fill background by default
Most clients will want background autofill, so let's make it the default mode.
Diffstat (limited to 'Libraries/LibGUI/TableView.cpp')
-rw-r--r--Libraries/LibGUI/TableView.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Libraries/LibGUI/TableView.cpp b/Libraries/LibGUI/TableView.cpp
index 64fb781fed..2c476e2886 100644
--- a/Libraries/LibGUI/TableView.cpp
+++ b/Libraries/LibGUI/TableView.cpp
@@ -40,6 +40,7 @@ namespace GUI {
TableView::TableView()
{
+ set_fill_with_background_color(true);
set_background_role(ColorRole::Base);
set_foreground_role(ColorRole::BaseText);
}
@@ -56,7 +57,8 @@ void TableView::paint_event(PaintEvent& event)
Painter painter(*this);
painter.add_clip_rect(frame_inner_rect());
painter.add_clip_rect(event.rect());
- painter.fill_rect(event.rect(), widget_background_color);
+ if (fill_with_background_color())
+ painter.fill_rect(event.rect(), widget_background_color);
painter.translate(frame_thickness(), frame_thickness());
painter.translate(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
@@ -144,7 +146,8 @@ void TableView::paint_event(PaintEvent& event)
};
Gfx::Rect unpainted_rect(0, header_height() + painted_item_index * item_height(), exposed_width, height());
- painter.fill_rect(unpainted_rect, widget_background_color);
+ if (fill_with_background_color())
+ painter.fill_rect(unpainted_rect, widget_background_color);
// Untranslate the painter vertically and do the column headers.
painter.translate(0, vertical_scrollbar().value());