diff --git a/src/entrybox.cpp b/src/entrybox.cpp index 7320f23..3fa0b4f 100644 --- a/src/entrybox.cpp +++ b/src/entrybox.cpp @@ -2,9 +2,8 @@ std::unordered_map> EntryBox::entry_histories; -EntryBox::Entry::Entry(const std::string &content, std::function on_activate_, unsigned width_chars) : Gtk::Entry(), on_activate(std::move(on_activate_)) { +EntryBox::Entry::Entry(const std::string &content, std::function on_activate_) : Gtk::Entry(), on_activate(std::move(on_activate_)) { set_max_length(0); - set_width_chars(width_chars); set_text(content); last_content = content; selected_history = -1; @@ -97,7 +96,7 @@ void EntryBox::clear() { void EntryBox::show() { std::vector focus_chain; for(auto &entry : entries) { - lower_box.pack_start(entry, Gtk::PACK_SHRINK); + lower_box.pack_start(entry, Gtk::PACK_EXPAND_WIDGET); focus_chain.emplace_back(&entry); } for(auto &button : buttons) diff --git a/src/entrybox.hpp b/src/entrybox.hpp index a118e85..d56ce2f 100644 --- a/src/entrybox.hpp +++ b/src/entrybox.hpp @@ -10,7 +10,7 @@ class EntryBox : public Gtk::Box { public: class Entry : public Gtk::Entry { public: - Entry(const std::string &content = "", std::function on_activate_ = nullptr, unsigned width_chars = -1); + Entry(const std::string &content = "", std::function on_activate_ = nullptr); std::function on_activate; private: diff --git a/src/window.cpp b/src/window.cpp index 080e762..7a99871 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1388,8 +1388,7 @@ void Window::set_menu_actions() { run_arguments.second, [run_arguments_first = std::move(run_arguments.first)](const std::string &content) { Project::run_arguments[run_arguments_first] = content; EntryBox::get().hide(); - }, - 50); + }); auto entry_it = EntryBox::get().entries.begin(); entry_it->set_placeholder_text("Run Arguments"); EntryBox::get().buttons.emplace_back("Set Run Arguments", [entry_it]() { @@ -1459,8 +1458,7 @@ void Window::set_menu_actions() { EntryBox::get().hide(); else EntryBox::get().entries.front().select_region(0, -1); - }, - 30); + }); auto entry_it = EntryBox::get().entries.begin(); entry_it->set_placeholder_text("Command"); EntryBox::get().buttons.emplace_back("Run Command", [entry_it]() { @@ -1494,8 +1492,7 @@ void Window::set_menu_actions() { run_arguments.second, [run_arguments_first = std::move(run_arguments.first)](const std::string &content) { Project::debug_run_arguments[run_arguments_first].arguments = content; EntryBox::get().hide(); - }, - 50); + }); auto entry_it = EntryBox::get().entries.begin(); entry_it->set_placeholder_text("Debug Run Arguments"); @@ -1572,8 +1569,7 @@ void Window::set_menu_actions() { last_run_debug_command = content; } EntryBox::get().hide(); - }, - 30); + }); auto entry_it = EntryBox::get().entries.begin(); entry_it->set_placeholder_text("Debug Command"); EntryBox::get().buttons.emplace_back("Run Debug Command", [entry_it]() {