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:
parent
27bd2eab22
commit
65a11fb5f9
Notes:
sideshowbarker
2024-07-19 04:46:07 +09:00
Author: https://github.com/tomuta
Commit: 65a11fb5f9
Pull-request: https://github.com/SerenityOS/serenity/pull/2820
11 changed files with 99 additions and 94 deletions
|
@ -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());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue