diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-24 04:28:36 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-24 04:28:36 +0100 |
commit | 86413a6f5a47593e78daaeca1d1af3def527b1d0 (patch) | |
tree | 9df2b5055b92d064e13852ac65405724658bfcfc /LibGUI/GTableView.cpp | |
parent | 7e54fdce996ef520624667ccc2c559b2cc5d6826 (diff) | |
download | serenity-86413a6f5a47593e78daaeca1d1af3def527b1d0.zip |
LibGUI+FileManager: Add a GIcon class to support multi-size icons.
A GIcon can contain any number of bitmaps internally, and will give you
the best fitting icon when you call bitmap_for_size().
Diffstat (limited to 'LibGUI/GTableView.cpp')
-rw-r--r-- | LibGUI/GTableView.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/LibGUI/GTableView.cpp b/LibGUI/GTableView.cpp index e753002ab7..81797be626 100644 --- a/LibGUI/GTableView.cpp +++ b/LibGUI/GTableView.cpp @@ -141,6 +141,9 @@ void GTableView::paint_event(GPaintEvent& event) auto data = model()->data(cell_index); if (data.is_bitmap()) { painter.blit(cell_rect.location(), data.as_bitmap(), data.as_bitmap().rect()); + } else if (data.is_icon()) { + if (auto bitmap = data.as_icon().bitmap_for_size(16)) + painter.blit(cell_rect.location(), *bitmap, bitmap->rect()); } else { Color text_color; if (is_selected_row) |