align in list

trunk
nbsp 2025-01-06 01:11:39 +02:00
parent fa210d8e23
commit 3120210931
No known key found for this signature in database
GPG Key ID: 7184AC1C9835CE48
3 changed files with 22 additions and 19 deletions

View File

@ -18,14 +18,14 @@ func NewManagement() *Management {
return &Management{ return &Management{
title, title,
ui.NewList([]string{ ui.NewList([]string{
" read over feels ", // TODO "read over feels", // TODO
" modify feels publishing ", // TODO "modify feels publishing", // TODO
" backup your feels ", // TODO "backup your feels", // TODO
" import a feels backup ", // TODO "import a feels backup", // TODO
" bury some feels ", // TODO "bury some feels", // TODO
" delete feels by day ", // TODO "delete feels by day", // TODO
" purge all feels ", // TODO "purge all feels", // TODO
" wipe feels account ", // TODO "wipe feels account", // TODO
}), }),
"↑↓/kj move ↵ enter q return", "↑↓/kj move ↵ enter q return",
} }

View File

@ -28,16 +28,16 @@ func NewMainMenu() *MainMenu {
return &MainMenu{ return &MainMenu{
title, title,
ui.NewList([]string{ ui.NewList([]string{
" record some feels ", "record some feels",
" manage your feels ", "manage your feels ",
" check out your neighbors ", // TODO "check out your neighbors", // TODO
" browse global feels ", // TODO "browse global feels", // TODO
" visit your subscriptions ", // TODO "visit your subscriptions", // TODO
" scribble some graffiti ", // TODO "scribble some graffiti", // TODO
" change your settings ", // TODO "change your settings", // TODO
" send some feedback ", // TODO "send some feedback", // TODO
" see credits ", "see credits",
" read documentation ", "read documentation",
}), }),
"↑↓/kj move ↵ enter q exit", "↑↓/kj move ↵ enter q exit",
} }

View File

@ -5,6 +5,9 @@
package ui package ui
import ( import (
"fmt"
"strconv"
"git.sr.ht/~rockorager/vaxis" "git.sr.ht/~rockorager/vaxis"
) )
@ -39,7 +42,7 @@ func (m *List) Draw(win vaxis.Window) {
} else { } else {
style = defaultStyle style = defaultStyle
} }
win.Println(i, vaxis.Segment{Text: subject, Style: style}) win.Println(i, vaxis.Segment{Text: fmt.Sprintf(" %-"+strconv.Itoa(win.Width-2)+"s", subject), Style: style})
} }
} }