mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibGUI: Add mimic_pressed to Button to signify being virtually clicked
A button that is "mimic pressed" is drawn like it is being clicked when it isn't necessarily actually being pressed. This lets programs which keyboard based input that mirrors a button to show visual feedback when a key is pressed.
This commit is contained in:
committed by
Linus Groh
parent
1fd16232d3
commit
e8f6a650ad
Notes:
sideshowbarker
2024-07-17 17:59:03 +09:00
Author: https://github.com/ForLoveOfCats Commit: https://github.com/SerenityOS/serenity/commit/e8f6a650ad Pull-request: https://github.com/SerenityOS/serenity/pull/12250 Reviewed-by: https://github.com/awesomekling
@@ -53,6 +53,9 @@ public:
|
||||
|
||||
bool another_button_has_focus() const { return m_another_button_has_focus; }
|
||||
|
||||
void set_mimic_pressed(bool mimic_pressed);
|
||||
bool is_mimic_pressed() const { return m_mimic_pressed; };
|
||||
|
||||
protected:
|
||||
explicit Button(String text = {});
|
||||
virtual void mousedown_event(MouseEvent&) override;
|
||||
@@ -67,6 +70,7 @@ private:
|
||||
WeakPtr<Action> m_action;
|
||||
int m_icon_spacing { 4 };
|
||||
bool m_another_button_has_focus { false };
|
||||
bool m_mimic_pressed { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user