mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibGUI: Add Widget::has_focus_within()
This returns true if the widget has focus, or if one of its descendant widgets does. Use this in StackWidget and TabWidget. This also fixes HackStudio crashing on startup in StackWidget, due to running before the window has a focused widget.
This commit is contained in:
parent
dee639f19b
commit
b11b4b29e9
4 changed files with 18 additions and 2 deletions
|
@ -165,6 +165,9 @@ public:
|
|||
bool is_focused() const;
|
||||
void set_focus(bool, FocusSource = FocusSource::Programmatic);
|
||||
|
||||
// Returns true if this widget or one of its descendants is focused.
|
||||
bool has_focus_within() const;
|
||||
|
||||
Widget* focus_proxy() { return m_focus_proxy; }
|
||||
const Widget* focus_proxy() const { return m_focus_proxy; }
|
||||
void set_focus_proxy(Widget*);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue