summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-05-24 12:34:23 -0400
committerJune McEnroe <june@causal.agency>2020-05-24 12:34:23 -0400
commit53f206f7e0a988cfc229a22ba0b929d7cdfcafff (patch)
tree9b7b0578155fee7e250f19a6733f00b5934adddb /ui.c
parentDon't compress man page or use configure on FreeBSD (diff)
downloadcatgirl-53f206f7e0a988cfc229a22ba0b929d7cdfcafff.tar.gz
catgirl-53f206f7e0a988cfc229a22ba0b929d7cdfcafff.zip
Tweak status line formatting
Diffstat (limited to '')
-rw-r--r--ui.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/ui.c b/ui.c
index 6fe7061..e91bd26 100644
--- a/ui.c
+++ b/ui.c
@@ -437,23 +437,28 @@ static void statusUpdate(void) {
 			others.unread += window->unreadWarm;
 			if (window->heat > others.heat) others.heat = window->heat;
 		}
-		int truncUnread, truncScroll;
-		char buf[256];
-		snprintf(
-			buf, sizeof(buf), "\3%d%s %u%s%s %s %n(\3%02d%d\3%d) %n[%d] ",
-			idColors[window->id], (num == windows.show ? "\26" : ""),
-			num, (window->mute ? "=" : ""), (window->ignore ? "" : "-"),
-			idNames[window->id],
-			&truncUnread, (window->heat > Warm ? White : idColors[window->id]),
-			window->unreadWarm,
-			idColors[window->id],
-			&truncScroll, window->scroll
+		char buf[256] = "";
+		catf(
+			buf, sizeof(buf), "\3%d%s %u ",
+			idColors[window->id], (num == windows.show ? "\26" : ""), num
 		);
-		if (!window->scroll) {
-			buf[truncScroll] = '\0';
-			if (!window->mark || !window->unreadWarm) {
-				buf[truncUnread] = '\0';
-			}
+		if (!window->ignore || window->mute) {
+			catf(
+				buf, sizeof(buf), "%s%s ",
+				&"-"[window->ignore], &"="[!window->mute]
+			);
+		}
+		catf(buf, sizeof(buf), "%s ", idNames[window->id]);
+		if (window->mark && window->unreadWarm) {
+			catf(
+				buf, sizeof(buf), "\3%d+%d\3%d%s",
+				(window->heat > Warm ? White : idColors[window->id]),
+				window->unreadWarm, idColors[window->id],
+				(window->scroll ? "" : " ")
+			);
+		}
+		if (window->scroll) {
+			catf(buf, sizeof(buf), "~%d ", window->scroll);
 		}
 		statusAdd(buf);
 	}
@@ -463,14 +468,14 @@ static void statusUpdate(void) {
 	snprintf(title, sizeof(title), "%s %s", network.name, idNames[window->id]);
 	if (window->mark && window->unreadWarm) {
 		catf(
-			title, sizeof(title), " (%d%s)",
-			window->unreadWarm, (window->heat > Warm ? "!" : "")
+			title, sizeof(title), " +%d%s",
+			window->unreadWarm, &"!"[window->heat < Hot]
 		);
 	}
 	if (others.unread) {
 		catf(
 			title, sizeof(title), " (+%d%s)",
-			others.unread, (others.heat > Warm ? "!" : "")
+			others.unread, &"!"[others.heat < Hot]
 		);
 	}
 }
ite.3?id=641cf03532dd36913190fdef180616db5570ecb8&follow=1'>Add gzwrite.3June McEnroe 2018-11-12Add gzfread.3June McEnroe 2018-11-12Add gzread.3June McEnroe 2018-11-12Add gzsetparams.3June McEnroe 2018-11-12Add gzbuffer.3June McEnroe 2018-11-12Add gzdopen to gzopen.3June McEnroe 2018-11-12Add gzopen.3June McEnroe 2018-11-12Add inflateBackEnd.3June McEnroe 2018-11-12Add inflateBack.3June McEnroe 2018-11-12Add inflateBackInit.3June McEnroe 2018-11-11Add inflateGetHeader.3June McEnroe 2018-11-11Add inflateMark.3June McEnroe 2018-11-11Add inflatePrime.3June McEnroe 2018-11-11Add inflateReset.3June McEnroe 2018-11-11Add inflateCopy.3June McEnroe 2018-11-11Add inflateSync.3June McEnroe 2018-11-11Add inflateGetDictionary.3June McEnroe 2018-11-11Add inflateSetDictionary.3June McEnroe 2018-11-11Add inflateInit2.3June McEnroe