mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
And add the first view into the loop so we can switch that one too
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
parent
069c7fb669
commit
e2446dab8c
1 changed files with 13 additions and 14 deletions
|
|
@ -195,21 +195,20 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||
titles["containers"] = gui.Tr.ContainersTitle
|
||||
}
|
||||
|
||||
if v, err := g.SetView("project", 0, 0, leftSideWidth, vHeights["project"]-1, gocui.BOTTOM|gocui.RIGHT); err != nil {
|
||||
if err.Error() != "unknown view" {
|
||||
return err
|
||||
}
|
||||
v.Title = titles["project"]
|
||||
v.FgColor = gocui.ColorDefault
|
||||
}
|
||||
|
||||
aboveContainersView := "project"
|
||||
aboveContainersView := ""
|
||||
for _, view := range gui.CyclableViews {
|
||||
if view == aboveContainersView {
|
||||
continue
|
||||
}
|
||||
if err = addView(g, view, aboveContainersView, titles[view], vHeights[view]); err != nil {
|
||||
return err
|
||||
if aboveContainersView == "" {
|
||||
if v, err := g.SetView(view, 0, 0, leftSideWidth, vHeights[view]-1, gocui.BOTTOM|gocui.RIGHT); err != nil {
|
||||
if err.Error() != "unknown view" {
|
||||
return err
|
||||
}
|
||||
v.Title = titles[view]
|
||||
v.FgColor = gocui.ColorDefault
|
||||
}
|
||||
} else {
|
||||
if err = addView(g, view, aboveContainersView, titles[view], vHeights[view]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
aboveContainersView = view
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue