From 4aee96be04ff62aec8bfd1012341c5dc900cbe5d Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 24 Jul 2014 09:30:48 +0100 Subject: [PATCH] Added an animation option to TabbedButtonBar::removeTab(). --- modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp | 4 ++-- modules/juce_gui_basics/layout/juce_TabbedButtonBar.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp index 67f46bc9a4..ed5c02f077 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp @@ -287,7 +287,7 @@ void TabbedButtonBar::setTabName (const int tabIndex, const String& newName) } } -void TabbedButtonBar::removeTab (const int tabIndex) +void TabbedButtonBar::removeTab (const int tabIndex, const bool animate) { const int oldIndex = currentTabIndex; if (tabIndex == currentTabIndex) @@ -296,7 +296,7 @@ void TabbedButtonBar::removeTab (const int tabIndex) tabs.remove (tabIndex); setCurrentTabIndex (oldIndex); - resized(); + updateTabPositions (animate); } void TabbedButtonBar::moveTab (const int currentIndex, const int newIndex, const bool animate) diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h index a9b2561071..31afbadb1f 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h @@ -212,7 +212,7 @@ public: void setTabName (int tabIndex, const String& newName); /** Gets rid of one of the tabs. */ - void removeTab (int tabIndex); + void removeTab (int tabIndex, bool animate = false); /** Moves a tab to a new index in the list. Pass -1 as the index to move it to the end of the list.