add option to remove gauge borders

This commit is contained in:
Ray Elliott 2021-05-31 17:39:35 +01:00
parent fc717d627e
commit a90bec834a
3 changed files with 6 additions and 1 deletions

View File

@ -33,7 +33,7 @@ type Gauge struct {
func NewGauge(c config.GaugeConfig, palette console.Palette) *Gauge {
g := Gauge{
Block: component.NewBlock(c.Title, true, palette),
Block: component.NewBlock(c.Title, *c.Border, palette),
Consumer: data.NewConsumer(),
color: *c.Color,
scale: *c.Scale,

View File

@ -65,6 +65,7 @@ type GaugeConfig struct {
Cur Item `yaml:"cur"`
Max Item `yaml:"max"`
Min Item `yaml:"min"`
Border *bool `yaml:"border,omitempty"`
}
type SparkLineConfig struct {

View File

@ -89,6 +89,10 @@ func (c *Config) setDefaultValues() {
p := defaultScale
g.Scale = &p
}
if g.Border == nil {
border := true
g.Border = &border
}
cur := "cur"
max := "max"