From 574bf11742c40203a4433c0b69264014b10b5a96 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 12 Oct 2008 17:27:00 +0000 Subject: container widget --- src/client/chat.cc | 7 ++----- src/client/chat.h | 2 +- src/client/client.cc | 4 ++-- src/client/input.cc | 6 +++--- 4 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src/client') diff --git a/src/client/chat.cc b/src/client/chat.cc index bdeebe2..87ba437 100644 --- a/src/client/chat.cc +++ b/src/client/chat.cc @@ -15,7 +15,7 @@ namespace client { -Chat::Chat(ui::Widget *parent) : ui::Widget(parent) +Chat::Chat(ui::Widget *parent) : ui::Window(parent) { set_label("chat"); history.clear(); @@ -42,10 +42,7 @@ Chat::~Chat() void Chat::show() { - Widget::show(); - - raise(); - set_focus(); + Window::show(); history_pos = history.rbegin(); (*history_pos).clear(); diff --git a/src/client/chat.h b/src/client/chat.h index 0bef2b4..f076075 100644 --- a/src/client/chat.h +++ b/src/client/chat.h @@ -16,7 +16,7 @@ namespace client { -class Chat : public ui::Widget +class Chat : public ui::Window { public: Chat(ui::Widget *parent = 0); diff --git a/src/client/client.cc b/src/client/client.cc index ac4c0e3..ae4f232 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -206,7 +206,7 @@ void Client::frame(float seconds) } else { // show the main menu on non-interactive modules if (!core::game()->interactive() && !ui::root()->active()) { - ui::root()->show_window("main"); + ui::root()->show_menu("main"); } } @@ -243,7 +243,7 @@ void Client::shutdown() void Client::notify_connect() { - ui::root()->hide_window(); + ui::root()->hide_menu(); } void Client::notify_disconnect() diff --git a/src/client/input.cc b/src/client/input.cc index d2c290b..22fd1c0 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -504,7 +504,7 @@ void key_pressed(Key *key) } else { if (ui::root()->active()) { - ui::root()->hide_window(); + ui::root()->hide_menu(); local_direction = 0.0f; local_pitch = 0.0f; local_roll = 0.0f; @@ -513,9 +513,9 @@ void key_pressed(Key *key) render::Camera::set_pitch(0.0f); } else { if (core::application()->connected()) { - ui::root()->show_window("game"); + ui::root()->show_menu("game"); } else { - ui::root()->show_window("main"); + ui::root()->show_menu("main"); } } } -- cgit v1.2.3