1702669045087618745

on kitten's pastes | raw

expires: 14 Mar, 2024

 1diff --git a/app.go b/app.go
 2index 3fe3112..4254cad 100644
 3--- a/app.go
 4+++ b/app.go
 5@@ -507,7 +507,7 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) {
 6 	if ev.Buttons()&tcell.ButtonPrimary != 0 {
 7 		if x < app.win.ChannelWidth() {
 8 			app.win.ClickBuffer(y + app.win.ChannelOffset())
 9-		} else if app.win.ChannelWidth() == 0 && y == h-1 {
10+		} else if app.win.ChannelWidth() == 0 && y == 0 {
11 			app.win.ClickBuffer(app.win.HorizontalBufferOffset(x))
12 		} else if x > w-app.win.MemberWidth() && y >= 2 {
13 			app.win.ClickMember(y - 2 + app.win.MemberOffset())
14@@ -535,7 +535,7 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) {
15 			if i := y + app.win.ChannelOffset(); i == app.win.ClickedBuffer() {
16 				app.win.GoToBufferNo(i)
17 			}
18-		} else if app.win.ChannelWidth() == 0 && y == h-1 {
19+		} else if app.win.ChannelWidth() == 0 && y == 0 {
20 			if i := app.win.HorizontalBufferOffset(x); i >= 0 && i == app.win.ClickedBuffer() {
21 				app.win.GoToBufferNo(i)
22 			}
23diff --git a/ui/ui.go b/ui/ui.go
24index 05ba87f..894fdad 100644
25--- a/ui/ui.go
26+++ b/ui/ui.go
27@@ -475,31 +475,33 @@ func (ui *UI) Draw(members []irc.Member) {
28 	w, h := ui.screen.Size()
29 
30 	if ui.channelWidth == 0 {
31-		ui.e.Draw(ui.screen, 9+ui.config.NickColWidth, h-2)
32+		ui.e.Draw(ui.screen, 9+ui.config.NickColWidth, h-1)
33 	} else {
34 		ui.e.Draw(ui.screen, 9+ui.channelWidth+ui.config.NickColWidth, h-1)
35 	}
36 
37-	ui.bs.DrawTimeline(ui.screen, ui.channelWidth, 0, ui.config.NickColWidth)
38 	if ui.channelWidth == 0 {
39-		ui.bs.DrawHorizontalBufferList(ui.screen, 0, h-1, w-ui.memberWidth, &ui.channelOffset)
40+		ui.bs.DrawHorizontalBufferList(ui.screen, 0, 0, w-ui.memberWidth, &ui.channelOffset)
41+		ui.bs.DrawTimeline(ui.screen, ui.channelWidth, 1, ui.config.NickColWidth)
42 	} else {
43+		ui.bs.DrawTimeline(ui.screen, ui.channelWidth, 0, ui.config.NickColWidth)
44 		ui.bs.DrawVerticalBufferList(ui.screen, 0, 0, ui.channelWidth, h, &ui.channelOffset)
45 	}
46 	if ui.memberWidth != 0 {
47 		ui.drawVerticalMemberList(ui.screen, w-ui.memberWidth, 0, ui.memberWidth, h, members, &ui.memberOffset)
48 	}
49 	if ui.channelWidth == 0 {
50-		ui.drawStatusBar(ui.channelWidth, h-3, w-ui.memberWidth)
51+		ui.drawStatusBar(ui.channelWidth, h-2, w-ui.memberWidth)
52 	} else {
53 		ui.drawStatusBar(ui.channelWidth, h-2, w-ui.channelWidth-ui.memberWidth)
54 	}
55 
56 	if ui.channelWidth == 0 {
57 		for x := 0; x < 9+ui.config.NickColWidth; x++ {
58+			ui.screen.SetContent(x, h-1, ' ', nil, tcell.StyleDefault)
59 			ui.screen.SetContent(x, h-2, ' ', nil, tcell.StyleDefault)
60 		}
61-		printIdent(ui.screen, 7, h-2, ui.config.NickColWidth, ui.prompt)
62+		printIdent(ui.screen, 7, h-1, ui.config.NickColWidth, ui.prompt)
63 	} else {
64 		for x := ui.channelWidth; x < 9+ui.channelWidth+ui.config.NickColWidth; x++ {
65 			ui.screen.SetContent(x, h-1, ' ', nil, tcell.StyleDefault)
66@@ -519,7 +521,7 @@ func (ui *UI) ScrollToBuffer() {
67 	w, h := ui.screen.Size()
68 	var first int
69 	if ui.channelWidth > 0 {
70-		first = ui.bs.current - h + 1
71+		first = ui.bs.current - h
72 	} else {
73 		first = ui.bs.GetLeftMost(w - ui.memberWidth)
74 	}