1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Tab button background colour fix when no tabs present.

This commit is contained in:
jules 2013-09-26 16:46:15 +01:00
parent 81c87652db
commit e7141058b7

View file

@ -335,8 +335,10 @@ void TabbedButtonBar::setCurrentTabIndex (int newIndex, const bool sendChangeMes
TabBarButton* TabbedButtonBar::getTabButton (const int index) const
{
TabInfo* const tab = tabs[index];
return tab == nullptr ? nullptr : static_cast <TabBarButton*> (tab->button);
if (TabInfo* tab = tabs[index])
return static_cast<TabBarButton*> (tab->button);
return nullptr;
}
int TabbedButtonBar::indexOfTabButton (const TabBarButton* button) const
@ -483,8 +485,10 @@ void TabbedButtonBar::resized()
//==============================================================================
Colour TabbedButtonBar::getTabBackgroundColour (const int tabIndex)
{
TabInfo* const tab = tabs [tabIndex];
return tab == nullptr ? Colours::white : tab->colour;
if (TabInfo* tab = tabs [tabIndex])
return tab->colour;
return Colours::transparentBlack;
}
void TabbedButtonBar::setTabBackgroundColour (const int tabIndex, Colour newColour)