1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibGUI: Add Widget focus proxies

A Widget can now have a focus proxy widget. Questions about focus are
redirected to the proxy if present. This is useful if a widget could
logically get focus, but wants one of its child widgets to actually
handle it.
This commit is contained in:
Andreas Kling 2020-08-25 11:21:49 +02:00
parent 9ba3862ee9
commit af16552624
Notes: sideshowbarker 2024-07-19 03:09:38 +09:00
2 changed files with 23 additions and 0 deletions

View file

@ -150,6 +150,10 @@ public:
bool is_focused() const;
void set_focus(bool, FocusSource = FocusSource::Programmatic);
Widget* focus_proxy() { return m_focus_proxy; }
const Widget* focus_proxy() const { return m_focus_proxy; }
void set_focus_proxy(Widget*);
enum class ShouldRespectGreediness { No = 0,
Yes };
struct HitTestResult {
@ -340,6 +344,8 @@ private:
bool m_accepts_emoji_input { false };
NonnullRefPtr<Gfx::PaletteImpl> m_palette;
WeakPtr<Widget> m_focus_proxy;
};
inline Widget* Widget::parent_widget()