MCPcopy
hub / github.com/docker/docker-agent / View

Method View

pkg/tui/dialog/theme_picker.go:247–271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245}
246
247func (d *themePickerDialog) View() string {
248 dialogWidth, _, contentWidth := d.dialogSize()
249 d.textInput.SetWidth(contentWidth)
250
251 gl := d.buildList(contentWidth)
252 d.updateScrollviewPosition()
253 d.scrollview.SetContent(gl.Lines(), len(gl.Lines()))
254
255 scrollableContent := d.scrollview.View()
256 if len(d.filtered) == 0 {
257 scrollableContent = d.renderEmptyState("No themes found", contentWidth)
258 }
259
260 content := NewContent(d.regionWidth(contentWidth)).
261 AddTitle("Select Theme").
262 AddSpace().
263 AddContent(d.textInput.View()).
264 AddSeparator().
265 AddContent(scrollableContent).
266 AddSpace().
267 AddHelpKeys("↑/↓", "navigate", "enter", "select", "esc", "cancel").
268 Build()
269
270 return styles.DialogStyle.Width(dialogWidth).Render(content)
271}
272
273func (d *themePickerDialog) renderTheme(theme ThemeChoice, selected bool, maxWidth int) string {
274 if maxWidth <= 0 {

Callers

nothing calls this directly

Calls 15

buildListMethod · 0.95
NewContentFunction · 0.85
SetContentMethod · 0.80
LinesMethod · 0.80
renderEmptyStateMethod · 0.80
AddHelpKeysMethod · 0.80
AddSpaceMethod · 0.80
AddSeparatorMethod · 0.80
AddTitleMethod · 0.80
regionWidthMethod · 0.80
ViewMethod · 0.65
RenderMethod · 0.65

Tested by

no test coverage detected