Skip to content

Commit

Permalink
fix(tui): Make tools pane width dependent on max category name length
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-he committed Dec 19, 2023
1 parent 7ee85c5 commit ee1d7c2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/control/cli/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,16 @@ func NewController(
tuiLogger.Debug().Interface("backlog", backlog).Msg("backlog")

tasksWidth := 40
toolsWidth := 20
toolsWidth := func() int {
width := 20
for _, c := range categoryStyling.GetAll() {
requisiteWidth := len(c.Cat.Name) + 4
if requisiteWidth > width {
width = requisiteWidth
}
}
return width
}()
rightFlexWidth := toolsWidth

statusHeight := 2
Expand Down

0 comments on commit ee1d7c2

Please sign in to comment.