mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:27:44 +00:00
LibGUI+FileSystemAccessServer: Avoid using dummy windows
Creates two new gatekept helpers for FilePicker and MessageBox to be used by FSAS to replace the "dummy window" approach to centering Dialogs. There was a slight delay in creating two windows, one a transparent intermediary hidden behind the second, to display FSAS Dialogs. Now we only need to make the window we actually see.
This commit is contained in:
parent
f76d24c2ec
commit
7323a54e59
6 changed files with 58 additions and 26 deletions
|
@ -16,6 +16,12 @@
|
|||
#include <LibGUI/ImageWidget.h>
|
||||
#include <LibGUI/Model.h>
|
||||
|
||||
namespace FileSystemAccessServer {
|
||||
|
||||
class ConnectionFromClient;
|
||||
|
||||
}
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class FilePicker final
|
||||
|
@ -34,6 +40,8 @@ public:
|
|||
static Optional<DeprecatedString> get_open_filepath(Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), bool folder = false, ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent, Optional<Vector<FileTypeFilter>> allowed_file_types = {});
|
||||
static Optional<DeprecatedString> get_save_filepath(Window* parent_window, DeprecatedString const& title, DeprecatedString const& extension, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
|
||||
static ErrorOr<Optional<String>> get_filepath(Badge<FileSystemAccessServer::ConnectionFromClient>, i32 window_server_client_id, i32 parent_window_id, Mode, StringView window_title, StringView file_basename = {}, StringView path = Core::StandardPaths::home_directory(), Optional<Vector<FileTypeFilter>> = {});
|
||||
|
||||
virtual ~FilePicker() override;
|
||||
|
||||
DeprecatedString const& selected_file() const { return m_selected_file; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue