mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:27:45 +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:
parent
9844088964
commit
6568765e8f
14 changed files with 27 additions and 26 deletions
|
@ -152,7 +152,7 @@ void DisplaySettingsWidget::create_frame()
|
|||
button.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
|
||||
button.set_preferred_size(22, 22);
|
||||
button.on_click = [this](auto) {
|
||||
Optional<String> open_path = GUI::FilePicker::get_open_filepath("Select wallpaper from file system.");
|
||||
Optional<String> open_path = GUI::FilePicker::get_open_filepath(root_widget()->window(), "Select wallpaper from file system.");
|
||||
|
||||
if (!open_path.has_value())
|
||||
return;
|
||||
|
|
|
@ -54,6 +54,7 @@ int main(int argc, char** argv)
|
|||
auto instance = DisplaySettingsWidget::construct();
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
dbg() << "main window: " << window;
|
||||
window->set_title("Display settings");
|
||||
window->move_to(100, 100);
|
||||
window->resize(360, 390);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue