From 2b9f1cfd8663ffd9c4126fce328658fdb37556ce Mon Sep 17 00:00:00 2001 From: Jaroslaw Hartman Date: Fri, 2 Feb 2024 18:49:33 +0100 Subject: [PATCH] Parameters width and position modification --- dialog/params.go | 2 +- dialog/view.go | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dialog/params.go b/dialog/params.go index c046d96..f8350b2 100644 --- a/dialog/params.go +++ b/dialog/params.go @@ -9,7 +9,7 @@ import ( var ( views = []string{} - layoutStep = 3 + layoutStep = 4 curView = -1 idxView = 0 diff --git a/dialog/view.go b/dialog/view.go index b7abe18..a495616 100644 --- a/dialog/view.go +++ b/dialog/view.go @@ -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++ }