diff --git a/ui/components/tabs/tabs.go b/ui/components/tabs/tabs.go index c893b92624bdf54e25bef38d4d60c1c16b410035..32ee1caf4aa8da3ecb1afaf992f4141d51f3a8f9 100644 --- a/ui/components/tabs/tabs.go +++ b/ui/components/tabs/tabs.go @@ -63,6 +63,15 @@ func (t *Tabs) Update(msg tea.Msg) (tea.Model, tea.Cmd) { t.activeTab = (t.activeTab - 1 + len(t.tabs)) % len(t.tabs) cmds = append(cmds, t.activeTabCmd) } + case tea.MouseMsg: + if msg.Type == tea.MouseLeft { + for i, tab := range t.tabs { + if t.common.Zone.Get(tab).InBounds(msg) { + t.activeTab = i + cmds = append(cmds, t.activeTabCmd) + } + } + } case SelectTabMsg: tab := int(msg) if tab >= 0 && tab < len(t.tabs) { @@ -86,7 +95,12 @@ func (t *Tabs) View() string { if t.UseDot { s.WriteString(prefix) } - s.WriteString(style.Render(tab)) + s.WriteString( + t.common.Zone.Mark( + tab, + style.Render(tab), + ), + ) if i != len(t.tabs)-1 { s.WriteString(sep.String()) }