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

@ -121,7 +121,7 @@ RefPtr<GUI::Menu> DebugInfoWidget::get_context_menu_for_variable(const GUI::Mode
auto* variable = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
if (does_variable_support_writing(variable)) {
context_menu->add_action(GUI::Action::create("Change value", [&](auto&) {
DeprecatedString value;
String value;
if (GUI::InputBox::show(window(), value, "Enter new value:"sv, "Set variable value"sv) == GUI::InputBox::ExecResult::OK) {
auto& model = static_cast<VariablesModel&>(*m_variables_view->model());
model.set_variable_value(index, value, window());