mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 20:22:31 +00:00
* Cleanup of TextElement.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@838 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -45,6 +45,13 @@
|
||||
|
||||
namespace display {
|
||||
|
||||
WindowText::WindowText(void* object, extent_type margin) :
|
||||
Window(new Canvas, 0, 0, 0, extent_static, extent_static),
|
||||
m_object(object),
|
||||
m_margin(margin),
|
||||
m_interval(0) {
|
||||
}
|
||||
|
||||
void
|
||||
WindowText::clear() {
|
||||
std::for_each(begin(), end(), rak::call_delete<TextElement>());
|
||||
@@ -78,7 +85,6 @@ WindowText::redraw() {
|
||||
m_canvas->erase();
|
||||
|
||||
unsigned int position = 0;
|
||||
Canvas::attributes_list attributes;
|
||||
|
||||
for (iterator itr = begin(); itr != end() && position < m_canvas->height(); ++itr, ++position) {
|
||||
if (*itr == NULL)
|
||||
@@ -86,8 +92,7 @@ WindowText::redraw() {
|
||||
|
||||
char buffer[m_canvas->width() + 1];
|
||||
|
||||
// Add a print function that sets up attributes etc?
|
||||
attributes.clear();
|
||||
Canvas::attributes_list attributes;
|
||||
attributes.push_back(Attributes(buffer, Attributes::a_normal, Attributes::color_default));
|
||||
|
||||
char* last = (*itr)->print(buffer, buffer + m_canvas->width(), &attributes, m_object);
|
||||
|
||||
Reference in New Issue
Block a user