Show poster thumbnails in the detail panes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@ type searchView struct {
|
||||
root *tview.Flex
|
||||
input *tview.InputField
|
||||
list *tview.List
|
||||
details *tview.TextView
|
||||
details *detailPane
|
||||
|
||||
// UI-goroutine state.
|
||||
results []result
|
||||
@@ -53,10 +53,9 @@ func newSearchView(app *App, be backend, cfg config.Arr) *searchView {
|
||||
cfg: cfg,
|
||||
input: tview.NewInputField().SetLabel("Search: "),
|
||||
list: tview.NewList().ShowSecondaryText(false),
|
||||
details: tview.NewTextView().SetDynamicColors(true).SetWordWrap(true),
|
||||
details: newDetailPane(app),
|
||||
}
|
||||
v.list.SetBorder(true).SetTitle(" " + be.noun() + " ")
|
||||
v.details.SetBorder(true).SetTitle(" Details ")
|
||||
|
||||
left := tview.NewFlex().SetDirection(tview.FlexRow).
|
||||
AddItem(v.input, 1, 0, true).
|
||||
@@ -231,7 +230,7 @@ func (v *searchView) render(sel int) {
|
||||
v.list.AddItem(r.label(), "", 0, nil)
|
||||
}
|
||||
if len(v.results) == 0 {
|
||||
v.details.SetText("")
|
||||
v.details.Clear()
|
||||
return
|
||||
}
|
||||
sel = min(max(sel, 0), len(v.results)-1)
|
||||
@@ -241,10 +240,10 @@ func (v *searchView) render(sel int) {
|
||||
|
||||
func (v *searchView) showDetails(i int) {
|
||||
if i < 0 || i >= len(v.results) {
|
||||
v.details.SetText("")
|
||||
v.details.Clear()
|
||||
return
|
||||
}
|
||||
v.details.SetText(v.results[i].details()).ScrollToBeginning()
|
||||
v.details.Show(v.results[i].details(), v.results[i].cover())
|
||||
}
|
||||
|
||||
// interactive opens the release list for the result at index i.
|
||||
|
||||
Reference in New Issue
Block a user