1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibGUI+Userland: Convert MessageBox to fallible construction

Adds fallible versions of MessageBox's helper factories, ports
DeprecatedString, and rewrites build() to be both fallible and
more responsive to font changes.

MessageBox now auto shrinks and no longer has to re-build its
layout when text changes. It is manually resized once at
creation to position properly as a Dialog before being shown.
This commit is contained in:
thankyouverycool 2023-04-14 08:52:09 -04:00 committed by Andreas Kling
parent aa94b944de
commit c9404c3a63
Notes: sideshowbarker 2024-07-16 21:21:57 +09:00
4 changed files with 92 additions and 83 deletions

View file

@ -352,7 +352,7 @@ void OutOfProcessWebView::notify_server_did_request_image_context_menu(Badge<Web
void OutOfProcessWebView::notify_server_did_request_alert(Badge<WebContentClient>, String const& message)
{
m_dialog = GUI::MessageBox::construct(window(), message, "Alert"sv, GUI::MessageBox::Type::Information, GUI::MessageBox::InputType::OK);
m_dialog = GUI::MessageBox::create(window(), message, "Alert"sv, GUI::MessageBox::Type::Information, GUI::MessageBox::InputType::OK).release_value_but_fixme_should_propagate_errors();
m_dialog->set_icon(window()->icon());
m_dialog->exec();
@ -362,7 +362,7 @@ void OutOfProcessWebView::notify_server_did_request_alert(Badge<WebContentClient
void OutOfProcessWebView::notify_server_did_request_confirm(Badge<WebContentClient>, String const& message)
{
m_dialog = GUI::MessageBox::construct(window(), message, "Confirm"sv, GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
m_dialog = GUI::MessageBox::create(window(), message, "Confirm"sv, GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel).release_value_but_fixme_should_propagate_errors();
m_dialog->set_icon(window()->icon());
client().async_confirm_closed(m_dialog->exec() == GUI::Dialog::ExecResult::OK);