Content-Type: text/html; charset=UTF-8 Last-Modified: Sat, 23 May 2026 20:05:15 GMT Expires: Tue, 20 May 2036 20:05:15 GMT catgirl - IRC client
summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/ui.c b/ui.c
index 90ba726..3ae6592 100644
--- a/ui.c
+++ b/ui.c
@@ -262,6 +262,40 @@ static void styleAdd(WINDOW *win, const char *str) {
 	}
 }
 
+static void statusUpdate(void) {
+	wmove(status, 0, 0);
+	int num;
+	const struct Window *window;
+	for (num = 0, window = windows.head; window; ++num, window = window->next) {
+		if (!window->unread && window != windows.active) continue;
+		enum Color color = hash(idNames[window->id]); // FIXME: queries.
+		int unread;
+		char buf[256];
+		snprintf(
+			buf, sizeof(buf), C"%d%s %d %s %n("C"%02d%d"C"%d) ",
+			color, (window == windows.active ? V : ""),
+			num, idNames[window->id],
+			&unread, (window->heat > Warm ? White : color), window->unread,
+			color
+		);
+		if (!window->unread) buf[unread] = '\0';
+		styleAdd(status, buf);
+	}
+	wclrtoeol(status);
+}
+
+void uiShowID(size_t id) {
+	struct Window *window = windowFor(id);
+	window->heat = Cold;
+	window->unread = 0;
+	window->mark = false;
+	if (windows.active) windows.active->mark = true;
+	windows.other = windows.active;
+	windows.active = window;
+	touchwin(window->pad);
+	statusUpdate();
+}
+
 void uiWrite(size_t id, enum Heat heat, const struct tm *time, const char *str) {
 	(void)time;
 	struct Window *window = windowFor(id);
page functionJohn Keeping2015-08-14 * diff: move layout to page functionJohn Keeping2015-08-14 * commit: move layout into page functionJohn Keeping2015-08-14 * about: move layout into page functionsJohn Keeping2015-08-14 * ui-shared: add cgit_print_layout_{start,end}()John Keeping2015-08-14 * html: remove html_status()John Keeping2015-08-14 * snapshot: don't reimplement cgit_print_error_page()John Keeping2015-08-14 * snapshot: use cgit_print_error_page() for HTTP status codesJohn Keeping2015-08-14 * patch: use cgit_print_error_page() for HTTP status codesJohn Keeping2015-08-14 * blob: use cgit_print_error_page() to add HTTP headersJohn Keeping2015-08-14 * snapshot: use cgit_print_error_page() instead of html_status()John Keeping2015-08-14 * plain: use cgit_print_error_page() instead of html_status()John Keeping2015-08-14 * clone: use cgit_print_error_page() instead of html_status()John Keeping2015-08-14 * cgit: use cgit_print_error_page() where appropriateJohn Keeping2015-08-14 * ui-shared: add cgit_print_error_page() functionJohn Keeping2015-08-14 * ui-patch: make sure to send http headersChristian Hesse2015-08-14 * Makefile: make "git/config.mak.uname" inclusion optionalJohn Keeping2015-08-13 * ui-shared: show full date in tooltip if longer ago than max_relativeJohn Keeping2015-08-13 * ui-shared: use common function in print_rel_date()John Keeping2015-08-13 * ui-shared: extract date formatting to a functionJohn Keeping2015-08-13 * filter: don't use dlsym unnecessarilyJohn Keeping2015-08-13 * ui-tree: use "sane" isgraph()John Keeping2015-08-13 * cgit.h: move stdbool.h from ui-shared.hJohn Keeping2015-08-13 * cache.c: fix header orderJohn Keeping2015-08-13 * configfile.c: don't include system headers directlyJohn Keeping2015-08-13 * Remove redundant includesJohn Keeping2015-08-13 * Makefile: include Git's config.mak.unameJohn Keeping2015-08-13 * tests: allow shell to be overriddenJohn Keeping2015-08-13 * redirect: cleanlinessJason A. Donenfeld2015-08-13 * redirect: be more careful for different cgi setupsJason A. Donenfeld2015-08-13 * ui-log: fix double countingJohn Keeping2015-08-12 * log: allow users to follow a fileJohn Keeping2015-08-12