about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--catgirl.12
-rw-r--r--ui.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/catgirl.1 b/catgirl.1
index 4571162..57b5cd4 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -445,6 +445,8 @@ Switch to previously selected window.
 Switch to previous window.
 .It Ic C-v
 Scroll down a page.
+.It Ic M--
+Toggle visibility of filtered messages.
 .It Ic M-/
 Switch to previously selected window.
 .It Ic M-a
diff --git a/ui.c b/ui.c
index c91ca04..3e9b95d 100644
--- a/ui.c
+++ b/ui.c
@@ -87,6 +87,7 @@ struct Window {
 	WINDOW *pad;
 	int scroll;
 	bool mark;
+	bool ignore;
 	enum Heat heat;
 	uint unread;
 	uint unreadWarm;
@@ -146,6 +147,7 @@ static uint windowFor(uint id) {
 	scrollok(window->pad, true);
 	wmove(window->pad, WindowLines - 1, 0);
 	window->mark = true;
+	window->ignore = true;
 
 	return windowPush(window);
 }
@@ -211,6 +213,7 @@ static short colorPair(short fg, short bg) {
 	X(KeyMetaU, "\33u", NULL) \
 	X(KeyMetaV, "\33v", NULL) \
 	X(KeyMetaEnter, "\33\r", "\33\n") \
+	X(KeyMetaMinus, "\33-", "\33_") \
 	X(KeyMetaSlash, "\33/", NULL) \
 	X(KeyFocusIn, "\33[I", NULL) \
 	X(KeyFocusOut, "\33[O", NULL) \
@@ -587,6 +590,7 @@ void uiWrite(uint id, enum Heat heat, const time_t *src, const char *str) {
 	struct Window *window = windows.ptrs[windowFor(id)];
 	time_t ts = (src ? *src : time(NULL));
 	bufferPush(&window->buffer, heat, ts, str);
+	if (heat < Cold && window->ignore) return;
 
 	int lines = 0;
 	window->unread++;
@@ -630,6 +634,7 @@ static void reflow(struct Window *window) {
 	for (size_t i = 0; i < BufferCap; ++i) {
 		struct Line line = bufferLine(&window->buffer, i);
 		if (!line.str) continue;
+		if (line.heat < Cold && window->ignore) continue;
 		int lines = wordWrap(window->pad, line.str);
 		if (i >= (size_t)(BufferCap - window->unread)) {
 			window->unreadLines += lines;
@@ -867,6 +872,7 @@ static void keyCode(int code) {
 		break; case KeyFocusOut: mark(window);
 
 		break; case KeyMetaEnter: edit(id, EditInsert, L'\n');
+		break; case KeyMetaMinus: window->ignore ^= true; reflow(window);
 		break; case KeyMetaSlash: windowShow(windows.swap);
 
 		break; case KeyMetaA: showAuto();
a href='/src/commit/www/photo.causal.agency/2024-09-22/lens?id=1215130a85ee9abe70d2e2c8af4eb0be368f4294&follow=1'>Add photos from September 22June McEnroe 2024-09-25Add photos from September 15June McEnroe 2024-09-24Add photos from September 14June McEnroe 2024-09-24Add photos from September 12June McEnroe 2024-09-24Add photos from September 7June McEnroe 2024-09-24Allow not having descriptionsJune McEnroe I'm sorry, I can't keep writing descriptions. It makes posting photos take too long, I often don't know the words for what I'm looking at, and a good description is an entirely different work of art than the photo I took, and I'm just a photographer. It's visual art. 2024-09-23Automatically select the last used lens for a bodyJune McEnroe 2024-09-19Add photos from September 5June McEnroe Had to prefix the folder number onto these file names manually because they must have come out of a different scanner or something. 2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe This seems easier to visually scan. The only other thing I'd like is a nicer date rendering but JavaScript is useless for that. 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe