From aefe3ef539dbdddcbe5d3a74ffb7c2b53b469027 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:14:34 -0500 Subject: LibGUI: Allow Windows to set a default return key widget The default return key widget takes precendence when dispatching return key events with the exception of focused buttons. --- Userland/Libraries/LibGUI/Window.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Userland/Libraries/LibGUI/Window.h') diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index dffb0adaa9..e75a14cbb7 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -151,6 +151,10 @@ public: return *widget; } + Widget* default_return_key_widget() { return m_default_return_key_widget; } + Widget const* default_return_key_widget() const { return m_default_return_key_widget; } + void set_default_return_key_widget(Widget*); + Widget* focused_widget() { return m_focused_widget; } const Widget* focused_widget() const { return m_focused_widget; } void set_focused_widget(Widget*, FocusSource = FocusSource::Programmatic); @@ -265,6 +269,7 @@ private: float m_opacity_when_windowless { 1.0f }; float m_alpha_hit_threshold { 0.0f }; RefPtr m_main_widget; + WeakPtr m_default_return_key_widget; WeakPtr m_focused_widget; WeakPtr m_automatic_cursor_tracking_widget; WeakPtr m_hovered_widget; -- cgit v1.2.3