mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-29 12:49:05 +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
Notes:
sideshowbarker
2024-07-17 04:19:05 +09:00
Author: https://github.com/thankyouverycool
Commit: 5d567565a4
Pull-request: https://github.com/SerenityOS/serenity/pull/16098
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