about summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-08 12:58:22 -0500
committerJune McEnroe <june@causal.agency>2018-12-08 13:18:13 -0500
commit14c60a15bca704873f88f46495559ee7d698f985 (patch)
tree79e37e5e91b7e3f58d13c8afbc1ecc49dea0f53e /ui.c
parentAdd /raw command (diff)
downloadtest-14c60a15bca704873f88f46495559ee7d698f985.tar.gz
test-14c60a15bca704873f88f46495559ee7d698f985.zip
Add uint typedef
Diffstat (limited to '')
-rw-r--r--ui.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui.c b/ui.c
index 9ffe8ad..e437ef9 100644
--- a/ui.c
+++ b/ui.c
@@ -68,8 +68,9 @@ static short pair8(short pair) {
 struct View {
 	struct Tag tag;
 	WINDOW *log;
-	int scroll, unread;
+	int scroll;
 	bool hot, mark;
+	uint unread;
 	struct View *prev;
 	struct View *next;
 };
@@ -227,7 +228,7 @@ static void uiTitle(const struct View *view) {
 	int unread;
 	char *str;
 	int len = asprintf(
-		&str, "%s%n (%d)", view->tag.name, &unread, view->unread
+		&str, "%s%n (%u)", view->tag.name, &unread, view->unread
 	);
 	if (len < 0) err(EX_OSERR, "asprintf");
 	if (!view->unread) str[unread] = '\0';
@@ -244,7 +245,7 @@ static void uiStatus(void) {
 		int unread;
 		wchar_t *str;
 		int len = aswprintf(
-			&str, L"%c %d %s %n(\3%02d%d\3) ",
+			&str, L"%c %d %s %n(\3%02d%u\3) ",
 			(view == ui.view ? IRCReverse : IRCReset),
 			num, view->tag.name,
 			&unread, (view->hot ? IRCYellow : IRCDefault), view->unread
@@ -274,7 +275,7 @@ static void viewRemove(struct View *view) {
 	views.tags[view->tag.id] = NULL;
 }
 
-static const int LogLines = 256;
+static const int LogLines = 512;
 
 static struct View *viewTag(struct Tag tag) {
 	struct View *view = views.tags[tag.id];
> 2019-02-22Reorganize UI code for the umpteenth timeJune McEnroe It's actually in a good state now, I think. 2019-02-21Replace "view" with "window"June McEnroe I think originally I didn't want to use the same word as curses WINDOW but it's really much clearer for the user if they're just called windows. UI code probably needs yet another rewrite though. Still feels messy. 2019-02-21Remove ROT13June McEnroe It's just not convenient when it can only do the whole line... 2019-02-21Clean up man pageJune McEnroe 2019-01-26Draw UI before connectingJune McEnroe Otherwise the "Traveling" message isn't visible while connecting. 2019-01-25Avoid unused variable warnings with getyxJune McEnroe 2019-01-25Add GNU/Linux build instructionsJune McEnroe