* Added various TextElement flags and replaced WindowPeerInfo with a

WindowText.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@756 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-08-12 18:35:19 +00:00
parent da0d5dbf22
commit 34258bcfb2
22 changed files with 402 additions and 319 deletions
+7 -2
View File
@@ -42,7 +42,7 @@
namespace display {
char*
TextElementValueBase::print(char* first, const char* last, Canvas::attributes_list* attributes, void* object) {
TextElementValueBase::print(char* first, char* last, Canvas::attributes_list* attributes, void* object) {
// Move this stuff into a function in TextElement.
Attributes base = attributes->back();
Attributes current(NULL, m_attributes, Attributes::color_invalid);
@@ -59,6 +59,7 @@ TextElementValueBase::print(char* first, const char* last, Canvas::attributes_li
int64_t val = value(object);
// Transform the value if needed.
if (m_flags & flag_elapsed)
val = cachedTime.seconds() - val;
else if (m_flags & flag_remaining)
@@ -67,7 +68,11 @@ TextElementValueBase::print(char* first, const char* last, Canvas::attributes_li
if (m_flags & flag_usec)
val = rak::timer(val).seconds();
if (m_flags & flag_timer) {
// Print the value.
if (first == last) {
// Do nothing, but ensure that the last attributes are set.
} else if (m_flags & flag_timer) {
if (val == 0)
first += std::max(snprintf(first, last - first + 1, "--:--:--"), 0);
else