mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +00:00
wip: filepicker, help, list, table, textarea, textinput, viewport
This commit is contained in:
+4
-4
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user