From 1a28393dabf4f4696bf433ddde52e7a25253c955 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 16 Oct 2008 16:34:15 +0000 Subject: various user interface related updates --- src/client/chat.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/client/chat.cc') diff --git a/src/client/chat.cc b/src/client/chat.cc index 6d294ba..9d51adc 100644 --- a/src/client/chat.cc +++ b/src/client/chat.cc @@ -23,9 +23,10 @@ Chat::Chat(ui::Widget *parent) : ui::Window(parent) chat_label = new ui::Label(this, "^BSay^F:^B"); chat_label->set_alignment(ui::AlignLeft | ui::AlignVCenter); + chat_label->set_border(false); - chat_input = new ui::Input(this); - chat_input->set_border(true); + chat_input = new ui::InputBox(this); + chat_input->set_border(false); chat_input->set_focus(); @@ -79,19 +80,17 @@ bool Chat::on_keypress(const int key, const unsigned int modifier) } case SDLK_RETURN: if (chat_input->text().size()) { - (*history_pos).assign(chat_input->text()); - // store input into history while (history.size() >= DEFAULT_MAX_HISTO_LINES) { history.pop_front(); } - if ((*history_pos).c_str()[0] == '/' || (*history_pos).c_str()[0] == '\\') { - core::cmd() << &(*history_pos).c_str()[1] << std::endl; + if (chat_input->text().c_str()[0] == '/' || chat_input->text().c_str()[0] == '\\') { + core::cmd() << &chat_input->text().c_str()[1] << std::endl; } else { - core::cmd() << "say " << (*history_pos) << std::endl; + core::cmd() << "say " << chat_input->text() << std::endl; } - (*history.rbegin()) = (*history_pos); + (*history.rbegin()) = chat_input->text(); history.push_back(""); history_pos = history.rbegin(); -- cgit v1.2.3