mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
LibGUI: Add visual indicator for accepted drags to BreadcrumbBar
BreadcrumbBar segments will now indicate drag acceptance with a rounded rectangle around the accepting segment.
This commit is contained in:
parent
b08ed1b560
commit
607c01fad1
1 changed files with 11 additions and 0 deletions
|
@ -50,12 +50,23 @@ public:
|
||||||
|
|
||||||
virtual void drag_enter_event(DragEvent& event) override
|
virtual void drag_enter_event(DragEvent& event) override
|
||||||
{
|
{
|
||||||
|
update();
|
||||||
if (on_drag_enter)
|
if (on_drag_enter)
|
||||||
on_drag_enter(event);
|
on_drag_enter(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void drag_leave_event(Event&) override
|
virtual void drag_leave_event(Event&) override
|
||||||
{
|
{
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void paint_event(PaintEvent& event) override
|
||||||
|
{
|
||||||
|
Button::paint_event(event);
|
||||||
|
if (has_pending_drop()) {
|
||||||
|
Painter painter(*this);
|
||||||
|
painter.draw_rect(rect(), palette().selection(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Function<void(DropEvent&)> on_drop;
|
Function<void(DropEvent&)> on_drop;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue