LibGUI: Add Widget focus policies

Every widget now has a GUI::FocusPolicy that determines how it can
receive focus:

- NoFocus: The widget is not focusable (default)
- TabFocus: The widget can be focused using the tab key.
- ClickFocus: The widget can be focused by clicking on it.
- StrongFocus: Both of the above.

For widgets that have a focus proxy, getting/setting the focus policy
will affect the proxy instead.
This commit is contained in:
Andreas Kling 2020-10-30 10:58:27 +01:00
commit aef56159a8
Notes: sideshowbarker 2024-07-19 01:38:37 +09:00
32 changed files with 64 additions and 40 deletions

View file

@ -34,6 +34,7 @@ GlyphMapWidget::GlyphMapWidget(Gfx::Font& mutable_font)
{
m_glyph_count = mutable_font.glyph_count();
set_relative_rect({ 0, 0, preferred_width(), preferred_height() });
set_focus_policy(GUI::FocusPolicy::StrongFocus);
}
GlyphMapWidget::~GlyphMapWidget()