From a54f4adb8f28855e7a8e5f24072f4d969b3b674d Mon Sep 17 00:00:00 2001 From: Kevin Kuehler Date: Mon, 10 Jun 2019 22:05:56 -0700 Subject: lib/ui/tab: Add Replace method Also expose a light wrapper method in aerc.go for tab replacement Signed-off-by: Kevin Kuehler --- widgets/aerc.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'widgets') diff --git a/widgets/aerc.go b/widgets/aerc.go index 5b1b151..ae8319b 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -218,6 +218,10 @@ func (aerc *Aerc) RemoveTab(tab ui.Drawable) { aerc.tabs.Remove(tab) } +func (aerc *Aerc) ReplaceTab(tabSrc ui.Drawable, tabTarget ui.Drawable, name string) { + aerc.tabs.Replace(tabSrc, tabTarget, name) +} + func (aerc *Aerc) NextTab() { next := aerc.tabs.Selected + 1 if next >= len(aerc.tabs.Tabs) { -- cgit 1.4.1-2-gfad0