mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 10:12:25 -05:00
ea9a39a9f2
This widget is automatically included in GStatusBar, but can be added in any other place, too. When clicked (with the left button), it initiates a window resize (using a WM request.) In this patch I also fixed up some issues with override cursors being cleared after the WindowServer finishes a drag or resize.
33 lines
847 B
C++
33 lines
847 B
C++
#pragma once
|
|
|
|
#include <SharedGraphics/GraphicsBitmap.h>
|
|
|
|
enum class WSStandardCursor {
|
|
None = 0,
|
|
Arrow,
|
|
IBeam,
|
|
ResizeHorizontal,
|
|
ResizeVertical,
|
|
ResizeDiagonalTLBR,
|
|
ResizeDiagonalBLTR,
|
|
};
|
|
|
|
class WSCursor : public Retainable<WSCursor> {
|
|
public:
|
|
static Retained<WSCursor> create(Retained<GraphicsBitmap>&&, const Point& hotspot);
|
|
static Retained<WSCursor> create(Retained<GraphicsBitmap>&&);
|
|
static RetainPtr<WSCursor> create(WSStandardCursor);
|
|
~WSCursor();
|
|
|
|
Point hotspot() const { return m_hotspot; }
|
|
const GraphicsBitmap& bitmap() const { return *m_bitmap; }
|
|
|
|
Rect rect() const { return m_bitmap->rect(); }
|
|
Size size() const { return m_bitmap->size(); }
|
|
|
|
private:
|
|
WSCursor(Retained<GraphicsBitmap>&&, const Point&);
|
|
|
|
RetainPtr<GraphicsBitmap> m_bitmap;
|
|
Point m_hotspot;
|
|
};
|