mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-08 23:29:21 +00:00
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:
@@ -60,6 +60,8 @@ Manager::adjust_layout() {
|
||||
|
||||
(*itr)->resize(0, height, Canvas::get_screen_width(), h);
|
||||
}
|
||||
|
||||
std::for_each(begin(), end(), std::mem_fun(&Window::mark_dirty));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef RTORRENT_WINDOW_BASE_H
|
||||
#define RTORRENT_WINDOW_BASE_H
|
||||
|
||||
#include "timer.h"
|
||||
|
||||
namespace display {
|
||||
|
||||
class Canvas;
|
||||
@@ -17,6 +19,8 @@ public:
|
||||
void refresh();
|
||||
void resize(int x, int y, int w, int h);
|
||||
|
||||
void mark_dirty() { m_lastDraw = 0; }
|
||||
|
||||
virtual void redraw() = 0;
|
||||
|
||||
protected:
|
||||
@@ -27,6 +31,8 @@ protected:
|
||||
|
||||
bool m_dynamic;
|
||||
int m_minHeight;
|
||||
|
||||
Timer m_lastDraw;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -15,10 +15,14 @@ WindowDownloadList::WindowDownloadList(DList* d) :
|
||||
|
||||
void
|
||||
WindowDownloadList::redraw() {
|
||||
m_canvas->erase();
|
||||
m_canvas->print_border(' ', ' ', '-', '-', ' ', ' ', ' ', ' ');
|
||||
if (Timer::cache() - m_lastDraw < 1000000)
|
||||
return;
|
||||
|
||||
int pos = 1;
|
||||
m_lastDraw = Timer::cache();
|
||||
|
||||
m_canvas->erase();
|
||||
|
||||
int pos = 0;
|
||||
|
||||
// Remember to check for end of screen too.
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
DList& get_list() { return *m_downloads; }
|
||||
|
||||
DList::iterator get_focus() { return m_focus; }
|
||||
void set_focus(DList::iterator itr) { m_focus = itr; }
|
||||
void set_focus(DList::iterator itr) { m_focus = itr; mark_dirty(); }
|
||||
|
||||
virtual void redraw();
|
||||
|
||||
|
||||
@@ -15,6 +15,10 @@ WindowPeerList::WindowPeerList(PList* l) :
|
||||
|
||||
void
|
||||
WindowPeerList::redraw() {
|
||||
if (Timer::cache() - m_lastDraw < 1000000)
|
||||
return;
|
||||
|
||||
m_lastDraw = Timer::cache();
|
||||
m_canvas->erase();
|
||||
|
||||
int x = 2;
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
PList& get_list() { return *m_list; }
|
||||
|
||||
PList::iterator get_focus() { return m_focus; }
|
||||
void set_focus(PList::iterator itr) { m_focus = itr; }
|
||||
void set_focus(PList::iterator itr) { m_focus = itr; mark_dirty(); }
|
||||
|
||||
void slot_chunks_total(SlotChunksTotal s) { m_slotChunksTotal = s; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user