aboutsummaryrefslogtreecommitdiffstats
path: root/gui/widget/tree.go
diff options
context:
space:
mode:
Diffstat (limited to 'gui/widget/tree.go')
-rw-r--r--gui/widget/tree.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/gui/widget/tree.go b/gui/widget/tree.go
index 14d7b9d..633d440 100644
--- a/gui/widget/tree.go
+++ b/gui/widget/tree.go
@@ -9,6 +9,8 @@ import (
"volute/gui/layout"
)
+const INDENT = 2
+
type Node[T any] struct {
Label string
Value T
@@ -50,7 +52,9 @@ func Tree[T any](trees []Node[T], r image.Rectangle, focus FocusSlave, mux *gui.
}
func flatten[T any](root Node[T], depth int) []string {
- indent := string(populate(make([]byte, 2*depth), ' '))
+ indent := string(populate(
+ make([]rune, INDENT*depth),
+ '─'))
nodes := []string{indent + root.Label}
root.expanded = true // TODO: remove me
if root.expanded {