1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 06:15:07 +00:00

LibGUI: Add visual indicators for accepted drags to view classes

All the view classes used in FileManager now indicate when they are
ready to accept a drop by showing a rounded rectangle around the item.
This commit is contained in:
Andreas Kling 2021-01-09 11:53:29 +01:00
parent 607c01fad1
commit 9e60fc5006
4 changed files with 13 additions and 1 deletions

View file

@ -161,6 +161,10 @@ void TableView::paint_event(PaintEvent& event)
painter.draw_rect(row_rect, widget_background_color);
painter.draw_focus_rect(row_rect, palette().focus_outline());
}
if (has_pending_drop() && selection_behavior() == SelectionBehavior::SelectRows && row_index == drop_candidate_index().row()) {
painter.draw_rect(row_rect, palette().selection(), true);
}
++painted_item_index;
};