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 { func NewGauge(c config.GaugeConfig, palette console.Palette) *Gauge {
g := Gauge{ g := Gauge{
Block: component.NewBlock(c.Title, true, palette), Block: component.NewBlock(c.Title, *c.Border, palette),
Consumer: data.NewConsumer(), Consumer: data.NewConsumer(),
color: *c.Color, color: *c.Color,
scale: *c.Scale, scale: *c.Scale,

View File

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

View File

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