wip: filepicker, help, list, table, textarea, textinput, viewport

This commit is contained in:
Carlos Alexandro Becker
2024-02-26 13:31:26 -03:00
parent 8f8d5fc7d9
commit e9bbc869c0
11 changed files with 76 additions and 62 deletions
+4 -4
View File
@@ -195,14 +195,14 @@ type Model struct {
}
// New returns a new model with sensible defaults.
func New(items []Item, delegate ItemDelegate, width, height int) Model {
styles := DefaultStyles()
func New(ctx *tea.Context, items []Item, delegate ItemDelegate, width, height int) Model {
styles := DefaultStyles(ctx.Renderer)
sp := spinner.New()
sp.Spinner = spinner.Line
sp.Style = styles.Spinner
filterInput := textinput.New()
filterInput := textinput.New(ctx)
filterInput.Prompt = "Filter: "
filterInput.PromptStyle = styles.FilterPrompt
filterInput.Cursor.Style = styles.FilterCursor
@@ -236,7 +236,7 @@ func New(items []Item, delegate ItemDelegate, width, height int) Model {
items: items,
Paginator: p,
spinner: sp,
Help: help.New(),
Help: help.New(ctx),
}
m.updatePagination()