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:
parent
81c87652db
commit
e7141058b7
1 changed files with 8 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue