Proper '/' on the end of directories in the find-file window.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@381 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-04-03 16:36:19 +00:00
parent fe11d1936d
commit 874e46fc64
15 changed files with 216 additions and 24 deletions
+1 -6
View File
@@ -57,9 +57,6 @@ WindowLog::redraw() {
int pos = 0;
//m_canvas->print(std::max(0, (int)m_canvas->get_width() / 2 - 5), pos++, "*** Log ***");
//m_canvas->print(0, 0, "___");
for (core::Log::iterator itr = m_log->begin(), end = find_older(); itr != end && pos < m_canvas->get_height(); ++itr)
m_canvas->print(0, pos++, "(%s) %s",
print_hhmmss(itr->first).c_str(),
@@ -69,9 +66,7 @@ WindowLog::redraw() {
void
WindowLog::receive_update() {
iterator itr = find_older();
int h = std::min(std::distance(m_log->begin(), itr),
(std::iterator_traits<iterator>::difference_type)10);
int h = std::min(std::distance(m_log->begin(), itr), (std::iterator_traits<iterator>::difference_type)10);
if (h != m_minHeight) {
set_active(h != 0);
+10 -2
View File
@@ -45,14 +45,18 @@ WindowStringList::redraw() {
size_t xpos = 1;
size_t width = 0;
for (iterator itr = m_first; itr != m_last; ++itr) {
iterator itr = m_first;
while (itr != m_last) {
if (ypos == (size_t)m_canvas->get_height()) {
ypos = 0;
xpos += width + 2;
if (xpos >= (size_t)m_canvas->get_width())
if (xpos + 20 >= (size_t)m_canvas->get_width())
break;
width = 0;
}
width = std::max(itr->size(), width);
@@ -61,7 +65,11 @@ WindowStringList::redraw() {
m_canvas->print(xpos, ypos++, "%s", itr->c_str());
else
m_canvas->print(xpos, ypos++, "%s", itr->substr(0, m_canvas->get_width() - xpos).c_str());
++itr;
}
m_drawEnd = itr;
}
}
+5 -1
View File
@@ -37,13 +37,17 @@ public:
WindowStringList();
~WindowStringList();
void set_range(iterator first, iterator last) { m_first = first; m_last = last; }
iterator get_draw_end() { return m_drawEnd; }
void set_range(iterator first, iterator last) { m_first = m_drawEnd = first; m_last = last; }
virtual void redraw();
private:
iterator m_first;
iterator m_last;
iterator m_drawEnd;
};
}