subsonic-tui/internal/tui/views/button.go
Sagi Dayan a3923cf42c initial commit
Signed-off-by: Sagi Dayan <sagidayan@gmail.com>
2024-03-29 17:56:39 +03:00

22 lines
534 B
Go

package views
import (
"git.dayanhub.com/sagi/subsonic-tui/internal/config"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
func NewButton(label string) *tview.Button {
style := tcell.Style{}
inactiveS := style.Background(config.ColorButtonBg).
Foreground(config.ColorButtonTxt).Bold(true)
activeS := style.Background(config.ColorButtonSelectedBg).
Foreground(config.ColorButtonSelectedTxt).Bold(true).Underline(true)
b := tview.NewButton(label)
b.SetStyle(inactiveS)
b.SetActivatedStyle(activeS)
return b
}