From 65603d5138b54efc53c04e756631ab8eeddee7fb Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 10 Feb 2020 17:54:16 -0500 Subject: Show heat and other unread in title --- ui.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/ui.c b/ui.c index 3f730d2..9a070a6 100644 --- a/ui.c +++ b/ui.c @@ -359,38 +359,45 @@ static void statusAdd(const char *str) { } static void statusUpdate(void) { + int otherUnread = 0; + enum Heat otherHeat = Cold; wmove(status, 0, 0); + int num; const struct Window *window; for (num = 0, window = windows.head; window; ++num, window = window->next) { if (!window->heat && window != windows.active) continue; - int unread; + if (window != windows.active) { + otherUnread += window->unreadCount; + if (window->heat > otherHeat) otherHeat = window->heat; + } + int trunc; char buf[256]; snprintf( buf, sizeof(buf), "\3%d%s %d %s %n(\3%02d%d\3%d) ", idColors[window->id], (window == windows.active ? "\26" : ""), num, idNames[window->id], - &unread, (window->heat > Warm ? White : idColors[window->id]), + &trunc, (window->heat > Warm ? White : idColors[window->id]), window->unreadCount, idColors[window->id] ); - if (!window->mark || !window->unreadCount) buf[unread] = '\0'; + if (!window->mark || !window->unreadCount) buf[trunc] = '\0'; statusAdd(buf); } wclrtoeol(status); + if (!to_status_line) return; - int unread; - char buf[256]; - snprintf( - buf, sizeof(buf), "%s %s%n (%d)", - self.network, idNames[windows.active->id], - &unread, windows.active->unreadCount - ); - if (!windows.active->mark || !windows.active->unreadCount) { - buf[unread] = '\0'; - } + window = windows.active; putp(to_status_line); - putp(buf); + printf("%s %s", self.network, idNames[window->id]); + if (window->mark && window->unreadCount) { + printf( + " (%d%s)", window->unreadCount, (window->heat > Warm ? "!" : "") + ); + } + if (otherUnread) { + printf(" (+%d%s)", otherUnread, (otherHeat > Warm ? "!" : "")); + } putp(from_status_line); fflush(stdout); } -- cgit 1.4.0 0eeb0b9ac24b73ae0f&follow=1'>www/causal.agency/index.7 (unfollow)
Commit message (Expand)Author
12 daysAdd photos from August 22June McEnroe
2024-08-16Add first roll through Zenit-122June McEnroe
2024-08-16Add ability to specify camera bodyJune McEnroe
2024-08-14Add photos from August 2June McEnroe
2024-08-13Add photos from July 30 (actually 29 evening)June McEnroe
2024-08-09Add photos from July 29June McEnroe
2024-08-08Add photos from July 27June McEnroe
2024-07-26Add photos from July 14June McEnroe
2024-07-16Add photos from July 9June McEnroe
2024-07-15Add photos from July 6June McEnroe
2024-07-10Add the end of the Harman Phoenix rollJune McEnroe
2024-07-08Add photos from July 3, the hikeJune McEnroe
2024-07-07Add photos from July 1June McEnroe
2024-07-07Add photos from June 25-30June McEnroe
2024-06-30Add photos from June 22 (and the few days after that)June McEnroe
2024-06-30Accommodate lower-case .jpg filesJune McEnroe
2024-06-23Add another BACKXWASH showJune McEnroe
2024-06-16Update bioJune McEnroe
2024-06-15Add photo descriptions from June 12June McEnroe
2024-06-10Add first roll of film from June 8June McEnroe
2024-06-10Cope with not having an EXIF infoJune McEnroe
2024-06-10Resize using target pixel counts for consistencyJune McEnroe
2024-06-10Add The Girl Who Was Convinced...June McEnroe
2024-06-09Add photos from May 31June McEnroe
2024-06-09Use monospace on photo pagesJune McEnroe
2024-06-09Put lens and (future) film at the tops of photo pagesJune McEnroe
2024-05-22Remove use of sysexits.hJune McEnroe
2024-05-22Add photo descriptions from 05-03 and 05-06June McEnroe
2024-05-21Fix = precedence in whenJune McEnroe