1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

LibGUI: Swap order of InputBox value and parent window args

This is now consistent with the other dialog classes.
This commit is contained in:
Linus Groh 2021-02-20 12:03:28 +01:00 committed by Andreas Kling
parent 3b9f110161
commit 3583b62ad3
14 changed files with 34 additions and 34 deletions

View file

@ -139,7 +139,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& file_
auto mkdir_action = Action::create("New directory...", Gfx::Bitmap::load_from_file("/res/icons/16x16/mkdir.png"), [this](const Action&) {
String value;
if (InputBox::show(value, this, "Enter name:", "New directory") == InputBox::ExecOK && !value.is_empty()) {
if (InputBox::show(this, value, "Enter name:", "New directory") == InputBox::ExecOK && !value.is_empty()) {
auto new_dir_path = LexicalPath::canonicalized_path(String::formatted("{}/{}", m_model->root_path(), value));
int rc = mkdir(new_dir_path.characters(), 0777);
if (rc < 0) {

View file

@ -46,7 +46,7 @@ InputBox::~InputBox()
{
}
int InputBox::show(String& text_value, Window* parent_window, const StringView& prompt, const StringView& title)
int InputBox::show(Window* parent_window, String& text_value, const StringView& prompt, const StringView& title)
{
auto box = InputBox::construct(parent_window, prompt, title);
box->set_resizable(false);

View file

@ -35,7 +35,7 @@ class InputBox : public Dialog {
public:
virtual ~InputBox() override;
static int show(String& text_value, Window* parent_window, const StringView& prompt, const StringView& title);
static int show(Window* parent_window, String& text_value, const StringView& prompt, const StringView& title);
private:
explicit InputBox(Window* parent_window, const StringView& prompt, const StringView& title);

View file

@ -105,7 +105,7 @@ void TextEditor::create_actions()
m_go_to_line_action = Action::create(
"Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"), [this](auto&) {
String value;
if (InputBox::show(value, window(), "Line:", "Go to line") == InputBox::ExecOK) {
if (InputBox::show(window(), value, "Line:", "Go to line") == InputBox::ExecOK) {
auto line_target = value.to_uint();
if (line_target.has_value()) {
set_cursor_and_focus_line(line_target.value() - 1, 0);