mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
LibGUI: Mimic a user click when calling Button::click()
The `mimic_pressed` function was primarily used in one place, the Calculator. This patch removes quite a lot of logic duplication there. It is also profitable to a lot of other places where `click()` was called without mimicking a click.
This commit is contained in:
committed by
Andreas Kling
parent
96b3063121
commit
d4ef2e226c
@@ -34,6 +34,7 @@ public:
|
||||
|
||||
bool is_hovered() const { return m_hovered; }
|
||||
bool is_being_pressed() const { return m_being_pressed; }
|
||||
bool was_being_pressed() const { return m_was_being_pressed; }
|
||||
|
||||
unsigned allowed_mouse_buttons_for_pressing() const { return m_allowed_mouse_buttons_for_pressing; }
|
||||
void set_allowed_mouse_buttons_for_pressing(unsigned allowed_buttons) { m_allowed_mouse_buttons_for_pressing = allowed_buttons; }
|
||||
@@ -66,6 +67,7 @@ private:
|
||||
bool m_checkable { false };
|
||||
bool m_hovered { false };
|
||||
bool m_being_pressed { false };
|
||||
bool m_was_being_pressed { false };
|
||||
bool m_being_keyboard_pressed { false };
|
||||
bool m_exclusive { false };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user