Skip to content

Commit

Permalink
breadcrumbs: improve styling customization
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Miller committed Mar 15, 2024
1 parent 3936a5c commit 5995f31
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions breadcrumb/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ import (
"github.com/kevm/bubbleo/styles"
)

type BreadcrumbStyles struct {
Frame lipgloss.Style
}

type Model struct {
Navstack *navstack.Model
FrameStyle lipgloss.Style
Navstack *navstack.Model
Styles BreadcrumbStyles
}

func New(n *navstack.Model) Model {
return Model{
Navstack: n,
FrameStyle: styles.BreadCrumbFrameStyle.Copy().Height(1),
Navstack: n,
Styles: DefaultStyles(),
}
}

Expand All @@ -42,5 +46,11 @@ func (m Model) View() string {
b.WriteString(c)
}
crumbs := b.String()
return m.FrameStyle.Render(crumbs)
return m.Styles.Frame.Render(crumbs)
}

func DefaultStyles() BreadcrumbStyles {
return BreadcrumbStyles{
Frame: styles.BreadCrumbFrameStyle,
}
}

0 comments on commit 5995f31

Please sign in to comment.