mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
LibGUI: Paint a focus rect around the cursor index in IconView
This makes the cursor actually visible to the user, and looks rather neat if I may say so. :^)
This commit is contained in:
parent
272af7685b
commit
5030f1ed4b
Notes:
sideshowbarker
2024-07-19 01:41:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5030f1ed4bb
1 changed files with 4 additions and 0 deletions
|
@ -523,6 +523,10 @@ void IconView::paint_event(PaintEvent& event)
|
|||
auto font = font_for_index(item_data.index);
|
||||
|
||||
painter.fill_rect(item_data.text_rect, background_color);
|
||||
if (is_focused() && item_data.index == cursor_index()) {
|
||||
painter.draw_rect(item_data.text_rect, widget_background_color);
|
||||
painter.draw_focus_rect(item_data.text_rect, palette().focus_outline());
|
||||
}
|
||||
|
||||
if (!item_data.wrapped_text_lines.is_empty()) {
|
||||
// Item text would not fit in the item text rect, let's break it up into lines..
|
||||
|
|
Loading…
Add table
Reference in a new issue