1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

LibGUI+WindowServer: Allow specifying an optional drag bitmap

This bitmap is displayed alongside the dragged text underneath the
mouse cursor while dragging.

This will be a perfect fit for dragging e.g files around. :^)
This commit is contained in:
Andreas Kling 2019-12-08 17:08:39 +01:00
parent 183ee5847c
commit f5dfb29607
5 changed files with 36 additions and 6 deletions

View file

@ -3,6 +3,7 @@
#include <LibCore/CEventLoop.h>
#include <LibCore/CObject.h>
class GraphicsBitmap;
class GWindowServerConnection;
class GDragOperation : public CObject {
@ -17,6 +18,7 @@ public:
virtual ~GDragOperation() override;
void set_text(const String& text) { m_text = text; }
void set_bitmap(const GraphicsBitmap* bitmap) { m_bitmap = bitmap; }
Outcome exec();
Outcome outcome() const { return m_outcome; }
@ -33,4 +35,5 @@ private:
OwnPtr<CEventLoop> m_event_loop;
Outcome m_outcome { Outcome::None };
String m_text;
RefPtr<GraphicsBitmap> m_bitmap;
};