LibGUI: Don't try to paint items in model-less IconView :^)

Fixes #6079.
This commit is contained in:
Andreas Kling 2021-04-03 20:36:43 +02:00
parent f1ea092d8f
commit 64d4921f35
Notes: sideshowbarker 2024-07-18 20:51:29 +09:00

View File

@ -515,6 +515,9 @@ void IconView::paint_event(PaintEvent& event)
painter.fill_rect(event.rect(), fill_with_background_color() ? widget_background_color : Color::Transparent);
if (!model())
return;
painter.translate(frame_thickness(), frame_thickness());
painter.translate(-horizontal_scrollbar().value(), -vertical_scrollbar().value());