From 9bea20442f25205efa09942c5cf77b7d13d7eb84 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Thu, 12 Dec 2019 11:29:53 -0800 Subject: [PATCH] Fix styling issue with IPInfo module Signed-off-by: Chris Cummer --- modules/ipaddresses/ipinfo/widget.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/ipaddresses/ipinfo/widget.go b/modules/ipaddresses/ipinfo/widget.go index 71ddc9b5..55230414 100644 --- a/modules/ipaddresses/ipinfo/widget.go +++ b/modules/ipaddresses/ipinfo/widget.go @@ -80,28 +80,28 @@ func (widget *Widget) setResult(info *ipinfo) { formatableText("City", "City") + formatableText("Region", "Region") + formatableText("Country", "Country") + - formatableText("Coords", "Coordinates") + + formatableText("Loc", "Coordinates") + formatableText("Org", "Organization"), ) resultBuffer := new(bytes.Buffer) resultTemplate.Execute(resultBuffer, map[string]string{ - "nameColor": widget.settings.common.Colors.Subheading, - "valueColor": widget.settings.common.Colors.Text, - "Ip": info.Ip, - "Hostname": info.Hostname, - "City": info.City, - "Region": info.Region, - "Country": info.Country, - "Coordinates": info.Coordinates, - "PostalCode": info.PostalCode, - "Organization": info.Organization, + "subheadingColor": widget.settings.common.Colors.Subheading, + "valueColor": widget.settings.common.Colors.Text, + "Ip": info.Ip, + "Hostname": info.Hostname, + "City": info.City, + "Region": info.Region, + "Country": info.Country, + "Coordinates": info.Coordinates, + "PostalCode": info.PostalCode, + "Organization": info.Organization, }) widget.result = resultBuffer.String() } func formatableText(key, value string) string { - return fmt.Sprintf(" [{{.nameColor}}]%8s: [{{.valueColor}}]{{.%s}}\n", key, value) + return fmt.Sprintf(" [{{.subheadingColor}}]%8s[-:-:-] [{{.valueColor}}]{{.%s}}\n", key, value) }