Skip to content

Commit

Permalink
fix(gui): add relative coordinates instead of absolute ones
Browse files Browse the repository at this point in the history
  • Loading branch information
danvergara committed May 8, 2021
1 parent ee89d9d commit 4c6563d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/gui/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
func (gui *Gui) layout(g *gocui.Gui) error {
maxX, maxY := gui.g.Size()

if v, err := g.SetView("banner", 0, 0, int(0.2*float32(maxX)), maxY-7); err != nil {
if v, err := g.SetView("banner", 0, 0, int(0.2*float32(maxX)), int(0.15*float32(maxY))); err != nil {
myFigure := figure.NewFigure("dblab", "", true)
figure.Write(v, myFigure)
}

if v, err := gui.g.SetView("tables", 0, 7, int(0.2*float32(maxX)), maxY-5); err != nil {
if v, err := gui.g.SetView("tables", 0, int(0.15*float32(maxY)), int(0.2*float32(maxX)), int(0.95*float32(maxY))); err != nil {
if err != gocui.ErrUnknownView {
return err
}
Expand All @@ -28,7 +28,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
v.Title = "Tables"
}

if v, err := gui.g.SetView("query", int(0.2*float32(maxX)), 0, maxX, maxY-40); err != nil {
if v, err := gui.g.SetView("query", int(0.2*float32(maxX)), 0, maxX, int(0.25*float32(maxY))); err != nil {
if err != gocui.ErrUnknownView {
return err
}
Expand All @@ -43,7 +43,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
}

if v, err := gui.g.SetView("rows", int(0.2*float32(maxX)), maxY-40, maxX, maxY-5); err != nil {
if v, err := gui.g.SetView("rows", int(0.2*float32(maxX)), int(0.25*float32(maxY)), maxX, int(0.95*float32(maxY))); err != nil {
if err != gocui.ErrUnknownView {
return err
}
Expand Down

0 comments on commit 4c6563d

Please sign in to comment.