add SetTitleColor and SetTitleAlign to dialog and gauge primitives

Signed-off-by: Navid Yaghoobi <navidys@fedoraproject.org>
This commit is contained in:
Navid Yaghoobi 2023-12-15 19:10:22 +11:00
parent c7479b197e
commit d909054147
5 changed files with 41 additions and 0 deletions

View File

@ -35,6 +35,7 @@ validate: gofmt lint govet pre-commit codespell ## Validate prometheus-podman-ex
.PHONY: lint
lint: ## Run golangci-lint
@echo "running golangci-lint"
GO111MODULE=off
$(BIN)/golangci-lint run
.PHONY: pre-commit

View File

@ -84,6 +84,16 @@ func (d *MessageDialog) SetTitle(title string) {
d.layout.SetTitle(title)
}
// SetTitleColor sets title color.
func (g *MessageDialog) SetTitleColor(color tcell.Color) {
g.layout.SetTitleColor(color)
}
// SetTitleAlign sets title alignment.
func (g *MessageDialog) SetTitleAlign(align int) {
g.Box.SetTitleAlign(align)
}
// SetBackgroundColor sets dialog background color.
func (d *MessageDialog) SetBackgroundColor(color tcell.Color) {
d.bgColor = color

View File

@ -44,6 +44,16 @@ func (g *ActivityModeGauge) SetTitle(title string) {
g.Box.SetTitle(title)
}
// SetTitleAlign sets title alignment.
func (g *ActivityModeGauge) SetTitleAlign(align int) {
g.Box.SetTitleAlign(align)
}
// SetTitleColor sets title color.
func (g *ActivityModeGauge) SetTitleColor(color tcell.Color) {
g.Box.SetTitleColor(color)
}
// Focus is called when this primitive receives focus.
func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive)) {
}

View File

@ -74,6 +74,16 @@ func (g *PercentageModeGauge) SetTitle(title string) {
g.Box.SetTitle(title)
}
// SetTitleColor sets title color.
func (g *PercentageModeGauge) SetTitleColor(color tcell.Color) {
g.Box.SetTitleColor(color)
}
// SetTitleAlign sets title alignment.
func (g *PercentageModeGauge) SetTitleAlign(align int) {
g.Box.SetTitleAlign(align)
}
// Focus is called when this primitive receives focus.
func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive)) {
}

View File

@ -53,6 +53,16 @@ func (g *UtilModeGauge) SetTitle(title string) {
g.Box.SetTitle(title)
}
// SetTitleColor sets title color.
func (g *UtilModeGauge) SetTitleColor(color tcell.Color) {
g.Box.SetTitleColor(color)
}
// SetTitleAlign sets title alignment.
func (g *UtilModeGauge) SetTitleAlign(align int) {
g.Box.SetTitleAlign(align)
}
// SetLabel sets label for this primitive.
func (g *UtilModeGauge) SetLabel(label string) {
g.label = label