1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

WindowServer: Make WSButton behave more like a normal button.

Previously it would just close the window on MouseDown. Now we do the normal
thing where we require a MouseUp inside the button rect before committing.
This commit is contained in:
Andreas Kling 2019-04-05 21:53:45 +02:00
parent 0d60c56b51
commit 0fc3ccaa52
6 changed files with 56 additions and 8 deletions

View file

@ -25,6 +25,7 @@ class WSWindow;
class WSClientConnection;
class WSWindowSwitcher;
class GraphicsBitmap;
class WSButton;
enum class ResizeDirection { None, Left, UpLeft, Up, UpRight, Right, DownRight, Down, DownLeft };
@ -98,6 +99,7 @@ public:
const WSCursor& move_cursor() const { return *m_move_cursor; }
void set_active_window(WSWindow*);
void set_cursor_tracking_button(WSButton* button) { m_cursor_tracking_button = button; }
private:
void process_mouse_event(const WSMouseEvent&, WSWindow*& event_window);
@ -202,6 +204,7 @@ private:
CircularQueue<float, 30> m_cpu_history;
String m_username;
WSButton* m_cursor_tracking_button { nullptr };
};
template<typename Callback>