| 68 | } |
| 69 | |
| 70 | func (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 | |