LibGUI+Userland: Improve error and font handling for InputBox

Adds fallible factories, ports DeprecatedString, and rebuilds the
layout to accomodate system font changes.
This commit is contained in:
thankyouverycool 2023-04-16 16:02:07 -04:00 committed by Andreas Kling
parent 9c2bcffe83
commit 02a9e5d3f6
Notes: sideshowbarker 2024-07-17 02:42:21 +09:00
19 changed files with 135 additions and 124 deletions

View file

@ -373,7 +373,7 @@ PDF::PDFErrorOr<void> PDFViewerWidget::try_open_file(StringView path, NonnullOwn
auto document = TRY(PDF::Document::create(m_buffer));
if (auto sh = document->security_handler(); sh && !sh->has_user_password()) {
DeprecatedString password;
String password;
while (true) {
auto result = GUI::InputBox::show(window(), password, "Password"sv, "Password required"sv, GUI::InputType::Password);
if (result == GUI::Dialog::ExecResult::OK