MCPcopy
hub / github.com/basecamp/once / View

Method View

internal/ui/settings_menu.go:70–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68}
69
70func (m SettingsMenu) View() string {
71 boxStyle := lipgloss.NewStyle().
72 Border(lipgloss.RoundedBorder()).
73 BorderForeground(Colors.Border).
74 Padding(1, 4)
75
76 titleStyle := lipgloss.NewStyle().
77 Bold(true).
78 Foreground(Colors.Primary).
79 MarginBottom(1)
80
81 title := titleStyle.Render("Settings")
82
83 m.menu.SetWidth(24)
84 menuView := m.menu.View()
85
86 helpView := m.help.View()
87 menuWidth := lipgloss.Width(menuView)
88 helpLine := lipgloss.NewStyle().MarginTop(1).Width(menuWidth).Align(lipgloss.Center).Render(helpView)
89
90 content := lipgloss.JoinVertical(lipgloss.Center,
91 title,
92 menuView,
93 helpLine,
94 )
95
96 return boxStyle.Render(content)
97}
98
99// Private
100

Callers 1

Calls 2

SetWidthMethod · 0.65
ViewMethod · 0.65

Tested by 1