Fixed styling of the other tools

This commit is contained in:
Leon Mika 2022-06-27 16:05:59 +10:00
parent 809f9adfea
commit eadf8d1720
19 changed files with 231 additions and 105 deletions

View file

@ -7,6 +7,7 @@ import (
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/layout"
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/statusandprompt"
"github.com/lmika/awstools/internal/ssm-browse/controllers"
"github.com/lmika/awstools/internal/ssm-browse/styles"
"github.com/lmika/awstools/internal/ssm-browse/ui/ssmdetails"
"github.com/lmika/awstools/internal/ssm-browse/ui/ssmlist"
"github.com/pkg/errors"
@ -23,11 +24,11 @@ type Model struct {
}
func NewModel(controller *controllers.SSMController, cmdController *commandctrl.CommandController) Model {
ssmList := ssmlist.New()
ssmdDetails := ssmdetails.New()
defaultStyles := styles.DefaultStyles
ssmList := ssmlist.New(defaultStyles.Frames)
ssmdDetails := ssmdetails.New(defaultStyles.Frames)
statusAndPrompt := statusandprompt.New(
layout.NewVBox(layout.LastChildFixedAt(17), ssmList, ssmdDetails),
"")
layout.NewVBox(layout.LastChildFixedAt(17), ssmList, ssmdDetails), "", defaultStyles.StatusAndPrompt)
cmdController.AddCommands(&commandctrl.CommandContext{
Commands: map[string]commandctrl.Command{

View file

@ -11,13 +11,6 @@ import (
"strings"
)
var (
activeHeaderStyle = lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#ffffff")).
Background(lipgloss.Color("#c144ff"))
)
type Model struct {
frameTitle frame.FrameTitle
viewport viewport.Model
@ -28,11 +21,11 @@ type Model struct {
selectedItem *models.SSMParameter
}
func New() *Model {
func New(style frame.Style) *Model {
viewport := viewport.New(0, 0)
viewport.SetContent("")
return &Model{
frameTitle: frame.NewFrameTitle("Item", false, activeHeaderStyle),
frameTitle: frame.NewFrameTitle("Item", false, style),
viewport: viewport,
}
}

View file

@ -9,13 +9,6 @@ import (
table "github.com/lmika/go-bubble-table"
)
var (
activeHeaderStyle = lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#ffffff")).
Background(lipgloss.Color("#c144ff"))
)
type Model struct {
frameTitle frame.FrameTitle
table table.Model
@ -25,8 +18,8 @@ type Model struct {
w, h int
}
func New() *Model {
frameTitle := frame.NewFrameTitle("SSM: /", true, activeHeaderStyle)
func New(style frame.Style) *Model {
frameTitle := frame.NewFrameTitle("SSM: /", true, style)
table := table.New(table.SimpleColumns{"name", "type", "value"}, 0, 0)
return &Model{