1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:45:07 +00:00

LibGUI: Port the drag&drop code to Core::MimeData

This commit is contained in:
Andreas Kling 2020-02-14 13:18:34 +01:00
parent 3cba9c3c25
commit 814d59f462
10 changed files with 59 additions and 53 deletions

View file

@ -28,7 +28,7 @@
#include <AK/JsonObject.h>
#include <AK/NeverDestroyed.h>
#include <AK/SharedBuffer.h>
#include <LibGfx/Bitmap.h>
#include <LibCore/MimeData.h>
#include <LibGUI/Action.h>
#include <LibGUI/Application.h>
#include <LibGUI/Event.h>
@ -36,6 +36,7 @@
#include <LibGUI/Widget.h>
#include <LibGUI/Window.h>
#include <LibGUI/WindowServerConnection.h>
#include <LibGfx/Bitmap.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -188,7 +189,7 @@ void Window::event(Core::Event& event)
if (!m_main_widget)
return;
auto result = m_main_widget->hit_test(drop_event.position());
auto local_event = make<DropEvent>(result.local_position, drop_event.text(), drop_event.data_type(), drop_event.data());
auto local_event = make<DropEvent>(result.local_position, drop_event.text(), drop_event.mime_data());
ASSERT(result.widget);
return result.widget->dispatch_event(*local_event, this);
}