shithub: orca

Download patch

ref: 729ec5d987506fbf4a76ff0cb168728d3dd13490
parent: f52fdefdd623584d40800f8e300276accf3ee876
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Feb 18 19:40:34 EST 2020

plan9: add annoying arrows for fields bigger than the window, need to style it better still

--- a/plan9.c
+++ b/plan9.c
@@ -576,6 +576,34 @@
 	r.min.y += Txtoff + max.y*glyphsz.y;
 	draw(screen, r, color[Dback], nil, ZP);
 
+	p = top;
+	p.y -= glyphsz.y/2;
+	for (i = 0; i < 3; i++) {
+		if (scroll.x > 0) {
+			p.x = top.x - Txtoff;
+			string(screen, p, color[Dfmed], ZP, font, "←");
+		}
+		if (max.x+scroll.x < field.width) {
+			p.x = top.x + max.x*glyphsz.x + Txtoff - glyphsz.x;
+			string(screen, p, color[Dfmed], ZP, font, "→");
+		}
+		p.y += glyphsz.y*max.y/2;
+	}
+
+	p = top;
+	p.x -= glyphsz.x/2;
+	for (i = 0; i < 3; i++) {
+		if (scroll.y > 0) {
+			p.y = screen->r.min.y;
+			string(screen, p, color[Dfmed], ZP, font, "↑");
+		}
+		if (max.y+scroll.y < field.height) {
+			p.y = top.y + max.y*glyphsz.y;
+			string(screen, p, color[Dfmed], ZP, font, "↓");
+		}
+		p.x += glyphsz.x*max.x/2;
+	}
+
 	i = 0;
 	sprint(s, "%udx%ud", field.width, field.height);
 	i += runesprint(linebuf, "%-10s", s);