mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +00:00
LibGUI+WindowServer: Implement drag-to-select behavior in GTextEditor.
To make this feel right, I needed to start passing keyboard modifiers along with mouse events. That allows shift-clicking to extend the selection. :^)
This commit is contained in:
parent
6d172725c0
commit
f40d11f06d
11 changed files with 73 additions and 21 deletions
|
@ -137,11 +137,12 @@ private:
|
|||
|
||||
class GMouseEvent final : public GEvent {
|
||||
public:
|
||||
GMouseEvent(Type type, const Point& position, unsigned buttons, GMouseButton button = GMouseButton::None)
|
||||
GMouseEvent(Type type, const Point& position, unsigned buttons, GMouseButton button, unsigned modifiers)
|
||||
: GEvent(type)
|
||||
, m_position(position)
|
||||
, m_buttons(buttons)
|
||||
, m_button(button)
|
||||
, m_modifiers(modifiers)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -150,11 +151,13 @@ public:
|
|||
int y() const { return m_position.y(); }
|
||||
GMouseButton button() const { return m_button; }
|
||||
unsigned buttons() const { return m_buttons; }
|
||||
unsigned modifiers() const { return m_modifiers; }
|
||||
|
||||
private:
|
||||
Point m_position;
|
||||
unsigned m_buttons { 0 };
|
||||
GMouseButton m_button { GMouseButton::None };
|
||||
unsigned m_modifiers { 0 };
|
||||
};
|
||||
|
||||
class GTimerEvent final : public GEvent {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue