(msg tea.Msg)
| 45 | } |
| 46 | |
| 47 | func (m SettingsMenu) Update(msg tea.Msg) (Component, tea.Cmd) { |
| 48 | switch msg := msg.(type) { |
| 49 | case MouseEvent: |
| 50 | var cmd tea.Cmd |
| 51 | m.help, cmd = m.help.Update(msg) |
| 52 | if cmd != nil { |
| 53 | return m, cmd |
| 54 | } |
| 55 | |
| 56 | case tea.KeyPressMsg: |
| 57 | if key.Matches(msg, settingsMenuCloseKey) { |
| 58 | return m, func() tea.Msg { return SettingsMenuCloseMsg{} } |
| 59 | } |
| 60 | |
| 61 | case MenuSelectMsg: |
| 62 | return m, m.selectSection(SettingsSectionType(msg.Key)) |
| 63 | } |
| 64 | |
| 65 | var cmd tea.Cmd |
| 66 | m.menu, cmd = m.menu.Update(msg) |
| 67 | return m, cmd |
| 68 | } |
| 69 | |
| 70 | func (m SettingsMenu) View() string { |
| 71 | boxStyle := lipgloss.NewStyle(). |
nothing calls this directly
no test coverage detected