commit 972d647
Hubert Hirtz
·
2025-08-24 12:58:17 +0000 UTC
parent 53b67f9
Only show mouse buttons when mouse is enabled i guess it means the user cannot discover features, but for users who go out of their ways to disable mouse it just clutters the screen.
1 files changed,
+20,
-18
M
ui/ui.go
M
ui/ui.go
+20,
-18
1@@ -869,7 +869,7 @@ func (ui *UI) drawVerticalMemberList(vx *Vaxis, x0, y0, width, height int, b *bu
2 width--
3 clearArea(vx, x0, y0, width, height)
4
5- if _, channel := ui.bs.Current(); channel == "" {
6+ if _, channel := ui.bs.Current(); channel == "" && ui.config.Mouse {
7 x := x0 + 1
8 printString(vx, &x, y0, Styled("Help", vaxis.Style{
9 Foreground: ui.config.Colors.Status,
10@@ -918,24 +918,26 @@ func (ui *UI) drawVerticalMemberList(vx *Vaxis, x0, y0, width, height int, b *bu
11 y0++
12 height--
13
14- var actions []string
15- if b.muted {
16- actions = append(actions, "→ Unmute")
17- } else {
18- actions = append(actions, "→ Mute")
19- }
20- if b.pinned {
21- actions = append(actions, "→ Unpin")
22- } else {
23- actions = append(actions, "→ Pin")
24- }
25- actions = append(actions, "→ Leave")
26- for i, action := range actions {
27- x := x0
28- ui.drawHorizontalLine(vx, x0, y0+height-(len(actions)-i)*2, width)
29- printString(vx, &x, y0+height-(len(actions)-i)*2+1, Styled(action, vaxis.Style{}))
30+ if ui.config.Mouse {
31+ var actions []string
32+ if b.muted {
33+ actions = append(actions, "→ Unmute")
34+ } else {
35+ actions = append(actions, "→ Mute")
36+ }
37+ if b.pinned {
38+ actions = append(actions, "→ Unpin")
39+ } else {
40+ actions = append(actions, "→ Pin")
41+ }
42+ actions = append(actions, "→ Leave")
43+ for i, action := range actions {
44+ x := x0
45+ ui.drawHorizontalLine(vx, x0, y0+height-(len(actions)-i)*2, width)
46+ printString(vx, &x, y0+height-(len(actions)-i)*2+1, Styled(action, vaxis.Style{}))
47+ }
48+ height -= 2 * len(actions)
49 }
50- height -= 2 * len(actions)
51
52 padding := 1
53 for _, m := range members {