Fixed styling of the other tools
This commit is contained in:
parent
809f9adfea
commit
eadf8d1720
19 changed files with 231 additions and 105 deletions
29
internal/ssm-browse/styles/styles.go
Normal file
29
internal/ssm-browse/styles/styles.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package styles
|
||||
|
||||
import (
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/frame"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/statusandprompt"
|
||||
)
|
||||
|
||||
type Styles struct {
|
||||
Frames frame.Style
|
||||
StatusAndPrompt statusandprompt.Style
|
||||
}
|
||||
|
||||
var DefaultStyles = Styles{
|
||||
Frames: frame.Style{
|
||||
ActiveTitle: lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("#ffffff")).
|
||||
Background(lipgloss.Color("#c144ff")),
|
||||
InactiveTitle: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("#000000")).
|
||||
Background(lipgloss.Color("#d1d1d1")),
|
||||
},
|
||||
StatusAndPrompt: statusandprompt.Style{
|
||||
ModeLine: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("#000000")).
|
||||
Background(lipgloss.Color("#d1d1d1")),
|
||||
},
|
||||
}
|
||||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue