subsonic-tui/internal/tui/views/button.go
Sagi Dayan a4d4c49de9
initial commit
Signed-off-by: Sagi Dayan <sagidayan@gmail.com>
2024-12-14 23:37:05 +02:00

21 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
}