Alot of UI work, resize fixed.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@253 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-04 19:50:59 +00:00
parent bd7849199c
commit e02974571a
15 changed files with 406 additions and 10 deletions
+27 -1
View File
@@ -15,14 +15,32 @@
#include "ui/control.h"
#include "ui/download_list.h"
#include "input/bindings.h"
#include "timer.h"
#include "signal_handler.h"
int64_t Timer::m_cache;
bool start_shutdown = false;
bool is_shutting_down = false;
core::Poll poll;
core::DownloadList downloads;
bool
is_resized() {
static int x = 0;
static int y = 0;
bool r = display::Canvas::get_screen_width() != x || display::Canvas::get_screen_height() != y;
x = display::Canvas::get_screen_width();
y = display::Canvas::get_screen_height();
return r;
}
void
set_shutdown() {
start_shutdown = true;
@@ -55,6 +73,10 @@ main(int argc, char** argv) {
uiDownloadList.activate();
// Register main key events.
input::Bindings inputMain;
uiControl.get_input().push_back(&inputMain);
poll.slot_read_stdin(sigc::mem_fun(uiControl.get_input(), &input::Manager::pressed));
poll.register_http();
@@ -76,7 +98,11 @@ main(int argc, char** argv) {
if (start_shutdown && !is_shutting_down)
do_shutdown();
uiControl.get_display().adjust_layout();
Timer::update();
if (is_resized())
uiControl.get_display().adjust_layout();
uiControl.get_display().do_update();
poll.poll();