LibGUI: Add InputBox::show with required parent window argument

Similar to MessageBox::show, this encourages passing in a window.
This commit is contained in:
Tom
2020-07-16 07:54:42 -06:00
committed by Andreas Kling
parent 27bd2eab22
commit 65a11fb5f9
11 changed files with 99 additions and 94 deletions

View File

@@ -84,11 +84,10 @@ DebugInfoWidget::DebugInfoWidget()
if (!is_valid_index(index))
return;
auto input = GUI::InputBox::construct("Enter new value:", "Set variable value", window());
if (input->exec() == GUI::InputBox::ExecOK) {
String value;
if (GUI::InputBox::show(value, window(), "Enter new value:", "Set variable value") == GUI::InputBox::ExecOK) {
auto& model = static_cast<VariablesModel&>(*m_variables_view->model());
model.set_variable_value(index, input->text_value(), window());
model.set_variable_value(index, value, window());
}
};
}