commit fa663fd

hovercats  ·  2024-04-13 06:36:32 +0000 UTC
parent 5e2d971
senpai: import
7 files changed,  +138, -0
+17, -0
 1@@ -0,0 +1,17 @@
 2+#!/bin/sh -e
 3+
 4+patch -p1 < top-bar.patch
 5+
 6+go build -a -ldflags="-w -s -extldflags '-static'" \
 7+    -trimpath \
 8+    -modcacherw \
 9+    ./cmd/senpai
10+
11+scdoc < doc/senpai.1.scd > senpai.1
12+scdoc < doc/senpai.5.scd > senpai.5
13+
14+mkdir -p "$1/usr/bin" "$1/usr/share/man/man1" "$1/usr/share/man/man5"
15+
16+cp senpai "$1/usr/bin/"
17+cp senpai.1 "$1/usr/share/man/man1/"
18+cp senpai.5 "$1/usr/share/man/man5/"
+2, -0
1@@ -0,0 +1,2 @@
2+c9903285a66fd58e4a4d2784b3a632f74d7fac1857eab4025b8ef3e4a0c8f157ef
3+3419b007ac772f024ea75eb8b064f05f3270b78849996edc63ea95740c2f7e14ca
+2, -0
1@@ -0,0 +1,2 @@
2+go    make
3+scdoc make
+22, -0
 1@@ -0,0 +1,22 @@
 2+/var/db/kiss/installed/senpai/version
 3+/var/db/kiss/installed/senpai/sources
 4+/var/db/kiss/installed/senpai/patches/top-bar.patch
 5+/var/db/kiss/installed/senpai/patches/
 6+/var/db/kiss/installed/senpai/manifest
 7+/var/db/kiss/installed/senpai/depends
 8+/var/db/kiss/installed/senpai/checksums
 9+/var/db/kiss/installed/senpai/build
10+/var/db/kiss/installed/senpai/
11+/var/db/kiss/installed/
12+/var/db/kiss/
13+/var/db/
14+/var/
15+/usr/share/man/man5/senpai.5
16+/usr/share/man/man5/
17+/usr/share/man/man1/senpai.1
18+/usr/share/man/man1/
19+/usr/share/man/
20+/usr/share/
21+/usr/bin/senpai
22+/usr/bin/
23+/usr/
+92, -0
 1@@ -0,0 +1,92 @@
 2+To: ~delthas/senpai-dev@lists.sr.ht
 3+Cc: sewn <sewn@disroot.org>
 4+Subject: [PATCH v1] Move horizontal buffer list to top instead of bottom when width is 0
 5+Date: Fri, 15 Dec 2023 22:39:28 +0300
 6+Message-ID: <20231215193929.2227-1-sewn@disroot.org>
 7+MIME-Version: 1.0
 8+Content-Transfer-Encoding: 8bit
 9+
10+---
11+ app.go   |  4 ++--
12+ ui/ui.go | 14 ++++++++------
13+ 2 files changed, 10 insertions(+), 8 deletions(-)
14+
15+diff --git a/app.go b/app.go
16+index 3fe3112..4254cad 100644
17+--- a/app.go
18++++ b/app.go
19+@@ -507,7 +507,7 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) {
20+ 	if ev.Buttons()&tcell.ButtonPrimary != 0 {
21+ 		if x < app.win.ChannelWidth() {
22+ 			app.win.ClickBuffer(y + app.win.ChannelOffset())
23+-		} else if app.win.ChannelWidth() == 0 && y == h-1 {
24++		} else if app.win.ChannelWidth() == 0 && y == 0 {
25+ 			app.win.ClickBuffer(app.win.HorizontalBufferOffset(x))
26+ 		} else if x > w-app.win.MemberWidth() && y >= 2 {
27+ 			app.win.ClickMember(y - 2 + app.win.MemberOffset())
28+@@ -535,7 +535,7 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) {
29+ 			if i := y + app.win.ChannelOffset(); i == app.win.ClickedBuffer() {
30+ 				app.win.GoToBufferNo(i)
31+ 			}
32+-		} else if app.win.ChannelWidth() == 0 && y == h-1 {
33++		} else if app.win.ChannelWidth() == 0 && y == 0 {
34+ 			if i := app.win.HorizontalBufferOffset(x); i >= 0 && i == app.win.ClickedBuffer() {
35+ 				app.win.GoToBufferNo(i)
36+ 			}
37+diff --git a/ui/ui.go b/ui/ui.go
38+index 05ba87f..894fdad 100644
39+--- a/ui/ui.go
40++++ b/ui/ui.go
41+@@ -475,31 +475,33 @@ func (ui *UI) Draw(members []irc.Member) {
42+ 	w, h := ui.screen.Size()
43+ 
44+ 	if ui.channelWidth == 0 {
45+-		ui.e.Draw(ui.screen, 9+ui.config.NickColWidth, h-2)
46++		ui.e.Draw(ui.screen, 9+ui.config.NickColWidth, h-1)
47+ 	} else {
48+ 		ui.e.Draw(ui.screen, 9+ui.channelWidth+ui.config.NickColWidth, h-1)
49+ 	}
50+ 
51+-	ui.bs.DrawTimeline(ui.screen, ui.channelWidth, 0, ui.config.NickColWidth)
52+ 	if ui.channelWidth == 0 {
53+-		ui.bs.DrawHorizontalBufferList(ui.screen, 0, h-1, w-ui.memberWidth, &ui.channelOffset)
54++		ui.bs.DrawHorizontalBufferList(ui.screen, 0, 0, w-ui.memberWidth, &ui.channelOffset)
55++		ui.bs.DrawTimeline(ui.screen, ui.channelWidth, 1, ui.config.NickColWidth)
56+ 	} else {
57++		ui.bs.DrawTimeline(ui.screen, ui.channelWidth, 0, ui.config.NickColWidth)
58+ 		ui.bs.DrawVerticalBufferList(ui.screen, 0, 0, ui.channelWidth, h, &ui.channelOffset)
59+ 	}
60+ 	if ui.memberWidth != 0 {
61+ 		ui.drawVerticalMemberList(ui.screen, w-ui.memberWidth, 0, ui.memberWidth, h, members, &ui.memberOffset)
62+ 	}
63+ 	if ui.channelWidth == 0 {
64+-		ui.drawStatusBar(ui.channelWidth, h-3, w-ui.memberWidth)
65++		ui.drawStatusBar(ui.channelWidth, h-2, w-ui.memberWidth)
66+ 	} else {
67+ 		ui.drawStatusBar(ui.channelWidth, h-2, w-ui.channelWidth-ui.memberWidth)
68+ 	}
69+ 
70+ 	if ui.channelWidth == 0 {
71+ 		for x := 0; x < 9+ui.config.NickColWidth; x++ {
72++			ui.screen.SetContent(x, h-1, ' ', nil, tcell.StyleDefault)
73+ 			ui.screen.SetContent(x, h-2, ' ', nil, tcell.StyleDefault)
74+ 		}
75+-		printIdent(ui.screen, 7, h-2, ui.config.NickColWidth, ui.prompt)
76++		printIdent(ui.screen, 7, h-1, ui.config.NickColWidth, ui.prompt)
77+ 	} else {
78+ 		for x := ui.channelWidth; x < 9+ui.channelWidth+ui.config.NickColWidth; x++ {
79+ 			ui.screen.SetContent(x, h-1, ' ', nil, tcell.StyleDefault)
80+@@ -519,7 +521,7 @@ func (ui *UI) ScrollToBuffer() {
81+ 	w, h := ui.screen.Size()
82+ 	var first int
83+ 	if ui.channelWidth > 0 {
84+-		first = ui.bs.current - h + 1
85++		first = ui.bs.current - h
86+ 	} else {
87+ 		first = ui.bs.GetLeftMost(w - ui.memberWidth)
88+ 	}
89+
90+base-commit: 5e771831a3196f49d4417e0f913da64a251e8cb5
91+-- 
92+2.43.0
93+
+2, -0
1@@ -0,0 +1,2 @@
2+https://git.sr.ht/~taiite/senpai/archive/v0.3.0.tar.gz
3+patches/top-bar.patch
+1, -0
1@@ -0,0 +1 @@
2+0.3.0 1