From 31202109314f777620cb85f0f83480119b2888fd Mon Sep 17 00:00:00 2001 From: nbsp Date: Mon, 6 Jan 2025 01:11:39 +0200 Subject: [PATCH] align in list --- app/management.go | 16 ++++++++-------- app/menu.go | 20 ++++++++++---------- ui/list.go | 5 ++++- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/app/management.go b/app/management.go index 9e6edbf..99a1d40 100644 --- a/app/management.go +++ b/app/management.go @@ -18,14 +18,14 @@ func NewManagement() *Management { return &Management{ title, ui.NewList([]string{ - " read over feels ", // TODO - " modify feels publishing ", // TODO - " backup your feels ", // TODO - " import a feels backup ", // TODO - " bury some feels ", // TODO - " delete feels by day ", // TODO - " purge all feels ", // TODO - " wipe feels account ", // TODO + "read over feels", // TODO + "modify feels publishing", // TODO + "backup your feels", // TODO + "import a feels backup", // TODO + "bury some feels", // TODO + "delete feels by day", // TODO + "purge all feels", // TODO + "wipe feels account", // TODO }), "↑↓/kj move ↵ enter q return", } diff --git a/app/menu.go b/app/menu.go index 88649a3..20d6c27 100644 --- a/app/menu.go +++ b/app/menu.go @@ -28,16 +28,16 @@ func NewMainMenu() *MainMenu { return &MainMenu{ title, ui.NewList([]string{ - " record some feels ", - " manage your feels ", - " check out your neighbors ", // TODO - " browse global feels ", // TODO - " visit your subscriptions ", // TODO - " scribble some graffiti ", // TODO - " change your settings ", // TODO - " send some feedback ", // TODO - " see credits ", - " read documentation ", + "record some feels", + "manage your feels ", + "check out your neighbors", // TODO + "browse global feels", // TODO + "visit your subscriptions", // TODO + "scribble some graffiti", // TODO + "change your settings", // TODO + "send some feedback", // TODO + "see credits", + "read documentation", }), "↑↓/kj move ↵ enter q exit", } diff --git a/ui/list.go b/ui/list.go index 06ff849..901d179 100644 --- a/ui/list.go +++ b/ui/list.go @@ -5,6 +5,9 @@ package ui import ( + "fmt" + "strconv" + "git.sr.ht/~rockorager/vaxis" ) @@ -39,7 +42,7 @@ func (m *List) Draw(win vaxis.Window) { } else { 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}) } }