mirror of
https://github.com/RGBCube/serenity
synced 2025-07-04 15:17:35 +00:00
LibGUI: Make view widgets fill background by default
Most clients will want background autofill, so let's make it the default mode.
This commit is contained in:
parent
c7b7b65309
commit
d17b42b28d
4 changed files with 12 additions and 4 deletions
|
@ -35,6 +35,7 @@ namespace GUI {
|
|||
|
||||
ListView::ListView()
|
||||
{
|
||||
set_fill_with_background_color(true);
|
||||
set_background_role(ColorRole::Base);
|
||||
set_foreground_role(ColorRole::BaseText);
|
||||
}
|
||||
|
@ -170,7 +171,8 @@ void ListView::paint_event(PaintEvent& event)
|
|||
};
|
||||
|
||||
Gfx::Rect unpainted_rect(0, painted_item_index * item_height(), exposed_width, height());
|
||||
painter.fill_rect(unpainted_rect, palette().color(background_role()));
|
||||
if (fill_with_background_color())
|
||||
painter.fill_rect(unpainted_rect, palette().color(background_role()));
|
||||
}
|
||||
|
||||
int ListView::item_count() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue