GTabWidget: Fill the entire tab widget instead of just the bar.

There's no guarantee that child widgets will paint everything, so let's have
GTabWidget fill itself.
This commit is contained in:
Andreas Kling 2019-05-07 17:00:56 +02:00
parent 1af9b6f102
commit 4f77b4e5bc
Notes: sideshowbarker 2024-07-19 14:12:29 +09:00

View File

@ -6,6 +6,8 @@
GTabWidget::GTabWidget(GWidget* parent)
: GWidget(parent)
{
set_fill_with_background_color(true);
set_background_color(Color::LightGray);
}
GTabWidget::~GTabWidget()
@ -81,8 +83,6 @@ void GTabWidget::paint_event(GPaintEvent& event)
GPainter painter(*this);
painter.add_clip_rect(event.rect());
painter.fill_rect(bar_rect(), Color::LightGray);
Rect container_rect { 0, bar_height(), width(), height() - bar_height() };
auto padding_rect = container_rect;
for (int i = 0; i < container_padding(); ++i) {