From 6a7a07f1c117eb3a38ac7a3a70e767f2fb85a5d0 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sun, 15 Mar 2020 20:12:15 -0700 Subject: [PATCH] WTF-847 Fix the formatting of the headings in the Docket widget Fixes #847 Signed-off-by: Chris Cummer --- modules/docker/client.go | 4 ++-- modules/docker/widget.go | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/docker/client.go b/modules/docker/client.go index d61e0a632..5f75bc224 100644 --- a/modules/docker/client.go +++ b/modules/docker/client.go @@ -110,11 +110,11 @@ func (widget *Widget) getSystemInfo() string { func (widget *Widget) getContainerStates() string { cntrs, err := widget.cli.ContainerList(context.Background(), types.ContainerListOptions{All: true}) if err != nil { - return errors.Wrapf(err, "could not get container list").Error() + return errors.Wrapf(err, " could not get container list").Error() } if len(cntrs) == 0 { - return "no containers" + return " no containers" } colorMap := map[string]string{ diff --git a/modules/docker/widget.go b/modules/docker/widget.go index 713538484..28632b4d3 100644 --- a/modules/docker/widget.go +++ b/modules/docker/widget.go @@ -1,6 +1,8 @@ package docker import ( + "fmt" + "github.com/docker/docker/client" "github.com/pkg/errors" "github.com/rivo/tview" @@ -54,11 +56,11 @@ func (widget *Widget) refreshDisplayBuffer() { widget.displayBuffer = "" - widget.displayBuffer += "[" + widget.settings.labelColor + "::bul]system\n" + widget.displayBuffer += fmt.Sprintf("[%s] System[white]\n", widget.settings.common.Colors.Subheading) widget.displayBuffer += widget.getSystemInfo() widget.displayBuffer += "\n" - widget.displayBuffer += "[" + widget.settings.labelColor + "::bul]containers\n" + widget.displayBuffer += fmt.Sprintf("[%s] Containers[white]\n", widget.settings.common.Colors.Subheading) widget.displayBuffer += widget.getContainerStates() }