Skip to content

Commit

Permalink
LibGUI: Use "OK, Cancel" button order in InputBox
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Apr 29, 2020
1 parent 77916f0 commit 9f32d71
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Libraries/LibGUI/InputBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ void InputBox::build()
button_container_inner.set_layout<HorizontalBoxLayout>();
button_container_inner.layout()->set_spacing(8);

m_cancel_button = button_container_inner.add<Button>();
m_cancel_button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
m_cancel_button->set_preferred_size(0, 20);
m_cancel_button->set_text("Cancel");
m_cancel_button->on_click = [this] {
dbgprintf("GUI::InputBox: Cancel button clicked\n");
done(ExecCancel);
};

m_ok_button = button_container_inner.add<Button>();
m_ok_button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
m_ok_button->set_preferred_size(0, 20);
Expand All @@ -98,6 +89,15 @@ void InputBox::build()
done(ExecOK);
};

m_cancel_button = button_container_inner.add<Button>();
m_cancel_button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
m_cancel_button->set_preferred_size(0, 20);
m_cancel_button->set_text("Cancel");
m_cancel_button->on_click = [this] {
dbgprintf("GUI::InputBox: Cancel button clicked\n");
done(ExecCancel);
};

m_text_editor->on_return_pressed = [this] {
m_ok_button->click();
};
Expand Down

0 comments on commit 9f32d71

Please sign in to comment.