diff options
author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-08-21 22:18:53 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-31 16:43:18 +0200 |
commit | 4bad2bf10062f95f366fe07fadf9798e9eb60af9 (patch) | |
tree | ff8059c876263b765a53047bde40bdd1e1e455d9 /Userland/Libraries/LibGUI | |
parent | ebe877887664097a4fa0499ead2d43caccf10479 (diff) | |
download | serenity-4bad2bf10062f95f366fe07fadf9798e9eb60af9.zip |
LibGUI: Reuse draw_item_text function in ListView
This commit will highlight searched text!
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r-- | Userland/Libraries/LibGUI/ListView.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGUI/ListView.cpp b/Userland/Libraries/LibGUI/ListView.cpp index 77e939fe47..6fbdd8bc34 100644 --- a/Userland/Libraries/LibGUI/ListView.cpp +++ b/Userland/Libraries/LibGUI/ListView.cpp @@ -124,16 +124,11 @@ void ListView::paint_list_item(Painter& painter, int row_index, int painted_item painter.blit(row_rect.location(), *bitmap, bitmap->rect(), opacity); } } else { - Color text_color; - if (is_selected_row) - text_color = is_focused() ? palette().selection_text() : palette().inactive_selection_text(); - else - text_color = index.data(ModelRole::ForegroundColor).to_color(palette().color(foreground_role())); auto text_rect = row_rect; text_rect.translate_by(horizontal_padding(), 0); text_rect.set_width(text_rect.width() - horizontal_padding() * 2); auto text_alignment = index.data(ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft); - painter.draw_text(text_rect, data.to_string(), font, text_alignment, text_color); + draw_item_text(painter, index, is_selected_row, text_rect, data.to_string(), font, text_alignment, Gfx::TextElision::None); } } |