diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-19 13:45:07 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-19 13:45:07 +0000 |
commit | 56cdfd3822d2800abdd2f912ab7f76a5764793a7 (patch) | |
tree | 2656c7ef694117e0554ae4a47bb09629c78ed8af /src/client/view.cc | |
parent | e6f1fad441a7737549f463ebac1c9de062b5173d (diff) |
scrollpane widget, updated chatbox
Diffstat (limited to 'src/client/view.cc')
-rw-r--r-- | src/client/view.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/client/view.cc b/src/client/view.cc index 13feade..a5da7d4 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -52,13 +52,12 @@ void time_to_stream(std::stringstream &str, float time) DevInfo::DevInfo(ui::Widget *parent) : ui::Widget(parent) { set_label("devinfo"); - set_border(true); + set_border(false); + set_background(false); } void DevInfo::draw() { - draw_border(); - std::stringstream textstream; core::Entity *target = targets::current(); float d = 0; @@ -88,7 +87,7 @@ void DevInfo::draw() } ui::paint::color(palette()->foreground()); - ui::paint::text(global_location(), font(), textstream); + ui::paint::text(global_location(), size(), font(), textstream); } /* -- Stats -------------------------------------------------------- */ @@ -96,7 +95,8 @@ void DevInfo::draw() Stats::Stats(ui::Widget *parent) : ui::Widget(parent) { set_label("stats"); - set_border(true); + set_border(false); + set_background(false); // clear counters for (size_t i =0; i < fps_counter_size; i++) @@ -111,8 +111,6 @@ Stats::Stats(ui::Widget *parent) : ui::Widget(parent) void Stats::draw() { - draw_border(); - // average fps fps_counter_time[fps_counter_index] = core::application()->time(); fps_counter_index = (fps_counter_index + 1 ) % fps_counter_size; @@ -157,7 +155,7 @@ void Stats::draw() } ui::paint::color(palette()->foreground()); - ui::paint::text(global_location(), font(), textstream); + ui::paint::text(global_location(), size(), font(), textstream); } /* -- KeyPress ----------------------------------------------------- */ @@ -165,16 +163,15 @@ void Stats::draw() KeyPress::KeyPress(ui::Widget *parent) : Widget(parent) { set_label("keypress"); - set_border(true); + set_border(false); + set_background(false); } void KeyPress::draw() { - draw_border(); - if(input::last_key_pressed()) { ui::paint::color(palette()->highlight()); - ui::paint::text(global_location(), size(), font(), input::last_key_pressed()->name(), ui::AlignCenter); + ui::paint::label(global_location(), size(), font(), input::last_key_pressed()->name(), ui::AlignCenter); } } @@ -212,8 +209,8 @@ void View::resize() set_size(parent()->size()); // reposition chat widget - view_chat->set_size(font()->width()*64, font()->height()*5); - view_chat->set_location(font()->width() * 0.5f, height() *0.5f); + view_chat->set_size(font()->width()*64, height() * 0.5f); + view_chat->set_location(font()->width(), height() - view_chat->height() - font()->height() * 4); // reposition devinfo widget view_devinfo->set_size(font()->width()*32, font()->height()*5); |