mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 14:02:51 +00:00
Userland: Accept drag_enter events for widgets supporting file drops
This patch will switch cursor to DragCopy when a user enters a widget while dragging file(s), giving them a visual clue that it *might* be dropped into this widget. This is a rather naive approach, as the cursor icon will change for any kind of file, as currently programs don't know the drag contents before dropping it. But after all I think it's better than nothing. :^)
This commit is contained in:
parent
461ee18d64
commit
0b7f5bbdfb
Notes:
sideshowbarker
2024-07-17 06:35:23 +09:00
Author: https://github.com/krkk
Commit: 0b7f5bbdfb
Pull-request: https://github.com/SerenityOS/serenity/pull/15930
21 changed files with 89 additions and 0 deletions
|
@ -119,6 +119,13 @@ void SoundPlayerWidgetAdvancedView::set_nonlinear_volume_slider(bool nonlinear)
|
|||
m_nonlinear_volume_slider = nonlinear;
|
||||
}
|
||||
|
||||
void SoundPlayerWidgetAdvancedView::drag_enter_event(GUI::DragEvent& event)
|
||||
{
|
||||
auto const& mime_types = event.mime_types();
|
||||
if (mime_types.contains_slow("text/uri-list"))
|
||||
event.accept();
|
||||
}
|
||||
|
||||
void SoundPlayerWidgetAdvancedView::drop_event(GUI::DropEvent& event)
|
||||
{
|
||||
event.accept();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue