Skip to content

Commit

Permalink
Parameters width and position modification
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaroslaw Hartman committed Feb 2, 2024
1 parent b5974c2 commit 2b9f1cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dialog/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

var (
views = []string{}
layoutStep = 3
layoutStep = 4
curView = -1
idxView = 0

Expand Down
10 changes: 7 additions & 3 deletions dialog/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ func GenerateParamsLayout(params map[string]string, command string) {

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

Expand Down

0 comments on commit 2b9f1cf

Please sign in to comment.