Skip to content

Commit a1ba29e

Browse files
authored
Merge pull request knqyf263#259 from jaroslawhartman/pet-main-knqyf263-views-size
Parameters width and position modification
2 parents 4e7458f + 11a8197 commit a1ba29e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Diff for: dialog/view.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,23 @@ func GenerateParamsLayout(params [][2]string, command string) {
4848
g.SetManagerFunc(layout)
4949

5050
maxX, maxY := g.Size()
51+
leftX := (maxX / 2) - (maxX / 3)
52+
rightX := (maxX / 2) + (maxX / 3)
53+
5154
generateView(g, "Command(TAB => Select next, ENTER => Execute command):",
52-
command, []int{maxX / 10, maxY / 10, (maxX / 2) + (maxX / 3), maxY/10 + 5}, false)
55+
command, []int{leftX, maxY / 10, rightX, maxY/10 + 5}, false)
5356
idx := 0
5457

5558
// Create a view for each param
5659
for _, pair := range params {
5760
// Unpack parameter key and value
5861
k, v := pair[0], pair[1]
59-
generateView(g, k, v, []int{maxX / 10, (maxY / 4) + (idx+1)*layoutStep,
60-
maxX/10 + 20, (maxY / 4) + 2 + (idx+1)*layoutStep}, true)
62+
generateView(g, k, v,
63+
[]int{leftX,
64+
(maxY / 4) + (idx+1)*layoutStep,
65+
rightX,
66+
(maxY / 4) + 2 + (idx+1)*layoutStep},
67+
true)
6168
idx++
6269
}
6370

0 commit comments

Comments
 (0)