Skip to content

Commit

Permalink
Altered max lengths of parameters, aligned to left
Browse files Browse the repository at this point in the history
  • Loading branch information
RamiAwar committed Feb 28, 2024
1 parent 2b9f1cf commit b1337a9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dialog/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ func GenerateParamsLayout(params map[string]string, command string) {
g.SetManagerFunc(layout)

maxX, maxY := g.Size()
leftX := (maxX / 2) - (maxX / 3)
rightX := (maxX / 2) + (maxX / 3)

generateView(g, "Command(TAB => Select next, ENTER => Execute command):",
command, []int{(maxX / 2) - (maxX / 3), maxY / 10, (maxX / 2) + (maxX / 3), maxY/10 + 5}, false)
command, []int{leftX, maxY / 10, rightX, maxY/10 + 5}, false)
idx := 0
for k, v := range params {
generateView(g, k, v,
[]int{(maxX / 2) - (maxX / 4),
[]int{leftX,
(maxY / 4) + (idx+1)*layoutStep,
(maxX / 2) + (maxX / 4),
rightX,
(maxY / 4) + 2 + (idx+1)*layoutStep},
true)
idx++
Expand Down

0 comments on commit b1337a9

Please sign in to comment.