LibGUI: Always focus the file name textbox in GUI::FilePicker

Previously we would only auto-focus it when choosing a save location.
It seems nice to have the same behavior when opening a file.
This commit is contained in:
Andreas Kling 2020-12-28 11:43:57 +01:00
parent a94d1626b5
commit 2bbf3b5d0b
Notes: sideshowbarker 2024-07-19 00:30:15 +09:00

View file

@ -191,9 +191,9 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, Options options, const
filename_label.set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
filename_label.set_preferred_size(60, 0);
m_filename_textbox = filename_container.add<TextBox>();
m_filename_textbox->set_focus(true);
if (m_mode == Mode::Save) {
m_filename_textbox->set_text(file_name);
m_filename_textbox->set_focus(true);
m_filename_textbox->select_all();
}
m_filename_textbox->on_return_pressed = [&] {