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

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
Notes: sideshowbarker 2024-07-19 04:46:07 +09:00
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());
}
};
}