mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +00:00
LibGUI+WindowServer: Replace WindowInput{Enter,Leave} Events
with WindowInput{Preempted,Restored} Events and allow Widgets to save the state of their focus preemption. As of now, only Popups will preempt input and trigger these events.
This commit is contained in:
parent
901878bad9
commit
5d567565a4
11 changed files with 50 additions and 45 deletions
|
@ -214,6 +214,9 @@ public:
|
|||
bool is_focused() const;
|
||||
void set_focus(bool, FocusSource = FocusSource::Programmatic);
|
||||
|
||||
bool focus_preempted() const { return m_focus_preempted; }
|
||||
void set_focus_preempted(bool b) { m_focus_preempted = b; }
|
||||
|
||||
Function<void(bool const, const FocusSource)> on_focus_change;
|
||||
|
||||
// Returns true if this widget or one of its descendants is focused.
|
||||
|
@ -440,6 +443,7 @@ private:
|
|||
bool m_visible { true };
|
||||
bool m_greedy_for_hits { false };
|
||||
bool m_auto_focusable { true };
|
||||
bool m_focus_preempted { false };
|
||||
bool m_enabled { true };
|
||||
bool m_updates_enabled { true };
|
||||
bool m_accepts_command_palette { true };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue