From 68f179021d304d6edf939ecf5fc7d0d073b16152 Mon Sep 17 00:00:00 2001 From: Jeffas Date: Mon, 2 Mar 2020 19:54:42 +0000 Subject: Add move-tab command --- widgets/aerc.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'widgets') diff --git a/widgets/aerc.go b/widgets/aerc.go index a0e356a..a9be47e 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -283,6 +283,14 @@ func (aerc *Aerc) SelectedTab() ui.Drawable { return aerc.tabs.Tabs[aerc.tabs.Selected].Content } +func (aerc *Aerc) SelectedTabIndex() int { + return aerc.tabs.Selected +} + +func (aerc *Aerc) NumTabs() int { + return len(aerc.tabs.Tabs) +} + func (aerc *Aerc) NewTab(clickable ui.Drawable, name string) *ui.Tab { tab := aerc.tabs.Add(clickable, name) aerc.tabs.Select(len(aerc.tabs.Tabs) - 1) @@ -297,6 +305,10 @@ func (aerc *Aerc) ReplaceTab(tabSrc ui.Drawable, tabTarget ui.Drawable, name str aerc.tabs.Replace(tabSrc, tabTarget, name) } +func (aerc *Aerc) MoveTab(i int) { + aerc.tabs.MoveTab(i) +} + func (aerc *Aerc) NextTab() { aerc.tabs.NextTab() } -- cgit 1.4.1-2-gfad0