mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
LibWeb: Require parent window argument for MessageBox
Since the vast majority of message boxes should be modal, require the parent window to be passed in, which can be nullptr for the rare case that they don't. By it being the first argument, the default arguments also don't need to be explicitly stated in most cases, and it encourages passing in a parent window handle. Fix up several message boxes that should have been modal.
This commit is contained in:
@@ -58,12 +58,12 @@ void Window::set_wrapper(Badge<Bindings::WindowObject>, Bindings::WindowObject&
|
||||
|
||||
void Window::alert(const String& message)
|
||||
{
|
||||
GUI::MessageBox::show(message, "Alert", GUI::MessageBox::Type::Information);
|
||||
GUI::MessageBox::show(nullptr, message, "Alert", GUI::MessageBox::Type::Information);
|
||||
}
|
||||
|
||||
bool Window::confirm(const String& message)
|
||||
{
|
||||
auto confirm_result = GUI::MessageBox::show(message, "Confirm", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
|
||||
auto confirm_result = GUI::MessageBox::show(nullptr, message, "Confirm", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
|
||||
return confirm_result == GUI::Dialog::ExecResult::ExecOK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user