summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorcitrons <citrons@mondecitronne.com>2025-06-02 06:40:29 -0500
committercitrons <citrons@mondecitronne.com>2025-06-02 06:40:29 -0500
commit58281da28614386809eab60c9dcbb86082354f1b (patch)
treefc53eba37cbad850f14b13a45cf5436a5f9acf00 /client
parent33e59b1b318ea911d9a63cd78c6bc5eee0bb4109 (diff)
indicate when the user is scrolled up
Diffstat (limited to 'client')
-rw-r--r--client/buffer/buffer.go4
-rw-r--r--client/ui.go20
2 files changed, 22 insertions, 2 deletions
diff --git a/client/buffer/buffer.go b/client/buffer/buffer.go
index 921ad00..3fea156 100644
--- a/client/buffer/buffer.go
+++ b/client/buffer/buffer.go
@@ -77,6 +77,10 @@ func (b *Buffer) ScrollBottom() {
b.scroll.ToStart()
}
+func (b *Buffer) ScrollPos() int {
+ return b.scroll.Get()
+}
+
func (b *Buffer) AtBottom() bool {
return b.scroll.AtFirst()
}
diff --git a/client/ui.go b/client/ui.go
index 2fc71f6..37b7d4e 100644
--- a/client/ui.go
+++ b/client/ui.go
@@ -65,13 +65,29 @@ func (a *application) show() {
})
a.getWin().Buffer().Show("buffer")
- tui.Push("status", tui.Box {
- Width: tui.Fill, Height: tui.BoxSize(1), Dir: tui.Right,
+ tui.Push("input border", tui.Box {
+ Width: tui.Fill, Height: 1, Dir: tui.Left,
Style: &tui.Style {Bg: tui.White, Fg: tui.Black},
})
+
+ if a.getWin().Buffer().ScrollPos() > 0 {
+ tui.Push("", tui.Box {Width: tui.TextSize, Height: 1, NoWrap: true})
+ if a.getWin().Buffer().AtTop() {
+ tui.Text("[TOP]", nil)
+ } else {
+ tui.Text("[MORE]", nil)
+ }
+ tui.Pop()
+ }
+ tui.Push("", tui.Box {Width: tui.Fill, Height: 1})
+ tui.Pop()
+
+ tui.Push("status", tui.Box {Width: tui.TextSize, Height: 1, NoWrap: true})
a.getWin().ShowStatusLine()
tui.Pop()
+ tui.Pop()
+
tui.Push("input container", tui.Box {
Width: tui.Fill, Height: tui.Children, Dir: tui.Right,
})