mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 17:58:49 +00:00
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().
This commit is contained in:
parent
7e54fdce99
commit
86413a6f5a
Notes:
sideshowbarker
2024-07-19 14:57:23 +09:00
Author: https://github.com/awesomekling
Commit: 86413a6f5a
12 changed files with 165 additions and 23 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue