mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 08:06:11 +00:00
LibGUI: Add parent window argument to FilePicker functions
Since FilePicker almost always should be modal, add the parent window as mandatory first argument.
This commit is contained in:
@@ -304,7 +304,7 @@ TextEditorWidget::TextEditorWidget()
|
||||
});
|
||||
|
||||
m_open_action = GUI::CommonActions::make_open_action([this](auto&) {
|
||||
Optional<String> open_path = GUI::FilePicker::get_open_filepath();
|
||||
Optional<String> open_path = GUI::FilePicker::get_open_filepath(window());
|
||||
|
||||
if (!open_path.has_value())
|
||||
return;
|
||||
@@ -321,7 +321,7 @@ TextEditorWidget::TextEditorWidget()
|
||||
});
|
||||
|
||||
m_save_as_action = GUI::Action::create("Save as...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"), [this](const GUI::Action&) {
|
||||
Optional<String> save_path = GUI::FilePicker::get_save_filepath(m_name.is_null() ? "Untitled" : m_name, m_extension.is_null() ? "txt" : m_extension);
|
||||
Optional<String> save_path = GUI::FilePicker::get_save_filepath(window(), m_name.is_null() ? "Untitled" : m_name, m_extension.is_null() ? "txt" : m_extension);
|
||||
if (!save_path.has_value())
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user