(key string)
| 40 | } |
| 41 | |
| 42 | func (v *SettingsView) HandleKey(key string) SettingsEvent { |
| 43 | switch key { |
| 44 | case "up": |
| 45 | if v.ActiveSection == SettingsSectionContent { |
| 46 | v.ActiveSection = SettingsSectionHeader |
| 47 | } |
| 48 | case "down": |
| 49 | if v.ActiveSection == SettingsSectionHeader { |
| 50 | v.ActiveSection = SettingsSectionContent |
| 51 | } |
| 52 | case "left": |
| 53 | if v.ActiveSection == SettingsSectionHeader { |
| 54 | return SettingsEventPrevView |
| 55 | } |
| 56 | case "right": |
| 57 | if v.ActiveSection == SettingsSectionHeader { |
| 58 | return SettingsEventNextView |
| 59 | } |
| 60 | case "esc": |
| 61 | return SettingsEventQuit |
| 62 | } |
| 63 | return SettingsEventNone |
| 64 | } |
| 65 | |
| 66 | func (v *SettingsView) Render(active bool, cfg *config.Config, configPath, version string) string { |
| 67 | headerFocused := active && v.ActiveSection == SettingsSectionHeader |
nothing calls this directly
no outgoing calls
no test coverage detected