diff options
author | Andreas Kling <kling@serenityos.org> | 2020-10-30 10:58:27 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-30 17:03:28 +0100 |
commit | aef56159a84a3e88422f7e7ebc11fe145ffe9075 (patch) | |
tree | 1ac8a8f2c652a2c3f0f9e39ff247e98909a09619 /Applications/Piano | |
parent | 34014fa838cbc7e427ae00818fdf8f665f0e7801 (diff) | |
download | serenity-aef56159a84a3e88422f7e7ebc11fe145ffe9075.zip |
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.
Diffstat (limited to 'Applications/Piano')
-rw-r--r-- | Applications/Piano/SamplerWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Applications/Piano/SamplerWidget.cpp b/Applications/Piano/SamplerWidget.cpp index bb6fa5a31c..aeffcfefe2 100644 --- a/Applications/Piano/SamplerWidget.cpp +++ b/Applications/Piano/SamplerWidget.cpp @@ -105,7 +105,7 @@ SamplerWidget::SamplerWidget(TrackManager& track_manager) m_open_button = m_open_button_and_recorded_sample_name_container->add<GUI::Button>(); m_open_button->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed); m_open_button->set_preferred_size(24, 24); - m_open_button->set_focusable(false); + m_open_button->set_focus_policy(GUI::FocusPolicy::TabFocus); m_open_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png")); m_open_button->on_click = [this](auto) { Optional<String> open_path = GUI::FilePicker::get_open_filepath(window()); |