LibGUI: Allow more programmatic control over GUI::InputBox

This will be needed for WebDriver, which will require constructing and
controlling dialogs manually. Currently, InputBox will only set its text
value when the OK button is pressed. This changes InputBox to update its
text when done(ExecResult::OK) is invoked in any way.

This also makes the text_value() method public, allows for setting the
text value, and allows for moving-in the initial text value.
This commit is contained in:
Timothy Flynn 2022-11-16 07:35:02 -05:00 committed by Linus Groh
commit 5b31a3dbc7
Notes: sideshowbarker 2024-07-17 07:48:42 +09:00
4 changed files with 23 additions and 6 deletions

View file

@ -115,6 +115,8 @@ void Dialog::done(ExecResult result)
if (!m_event_loop)
return;
m_result = result;
on_done(m_result);
dbgln("{}: Quit event loop with result {}", *this, to_underlying(result));
m_event_loop->quit(to_underlying(result));
}