mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibGUI+Userland: Make Dialog::ExecResult an enum class
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 10:55:07 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/cdffe556c8 Pull-request: https://github.com/SerenityOS/serenity/pull/14021 Reviewed-by: https://github.com/linusg ✅
@@ -25,7 +25,7 @@ InputBox::InputBox(Window* parent_window, String& text_value, StringView prompt,
|
||||
build(input_type);
|
||||
}
|
||||
|
||||
int InputBox::show(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type)
|
||||
Dialog::ExecResult InputBox::show(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type)
|
||||
{
|
||||
auto box = InputBox::construct(parent_window, text_value, prompt, title, placeholder, input_type);
|
||||
box->set_resizable(false);
|
||||
@@ -87,7 +87,7 @@ void InputBox::build(InputType input_type)
|
||||
m_ok_button->on_click = [this](auto) {
|
||||
dbgln("GUI::InputBox: OK button clicked");
|
||||
m_text_value = m_text_editor->text();
|
||||
done(ExecOK);
|
||||
done(ExecResult::OK);
|
||||
};
|
||||
m_ok_button->set_default(true);
|
||||
|
||||
@@ -95,7 +95,7 @@ void InputBox::build(InputType input_type)
|
||||
m_cancel_button->set_text("Cancel");
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
dbgln("GUI::InputBox: Cancel button clicked");
|
||||
done(ExecCancel);
|
||||
done(ExecResult::Cancel);
|
||||
};
|
||||
|
||||
m_text_editor->on_escape_pressed = [this] {
|
||||
|
||||
Reference in New Issue
Block a user