|
@@ -30,9 +30,9 @@
|
|
|
|
|
|
namespace GUI {
|
|
|
|
|
|
-Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title, const StringView& path, bool folder)
|
|
|
+Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title, const StringView& path, bool folder, ScreenPosition screen_position)
|
|
|
{
|
|
|
- auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, "", path);
|
|
|
+ auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, "", path, screen_position);
|
|
|
|
|
|
if (!window_title.is_null())
|
|
|
picker->set_title(window_title);
|
|
@@ -48,9 +48,9 @@ Optional<String> FilePicker::get_open_filepath(Window* parent_window, const Stri
|
|
|
return {};
|
|
|
}
|
|
|
|
|
|
-Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension, const StringView& path)
|
|
|
+Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension, const StringView& path, ScreenPosition screen_position)
|
|
|
{
|
|
|
- auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path);
|
|
|
+ auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path, screen_position);
|
|
|
|
|
|
if (picker->exec() == Dialog::ExecOK) {
|
|
|
String file_path = picker->selected_file();
|
|
@@ -63,8 +63,8 @@ Optional<String> FilePicker::get_save_filepath(Window* parent_window, const Stri
|
|
|
return {};
|
|
|
}
|
|
|
|
|
|
-FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filename, const StringView& path)
|
|
|
- : Dialog(parent_window)
|
|
|
+FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filename, const StringView& path, ScreenPosition screen_position)
|
|
|
+ : Dialog(parent_window, screen_position)
|
|
|
, m_model(FileSystemModel::create(path))
|
|
|
, m_mode(mode)
|
|
|
{
|