mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-20 01:14:20 +00:00
TabbedButtonBar: made sure that when the buttons contain an extra component, the tab's text doesn't overlap it.
This commit is contained in:
parent
286c256eeb
commit
137b50f3a4
1 changed files with 19 additions and 0 deletions
|
|
@ -93,7 +93,26 @@ void TabBarButton::calcAreas (Rectangle<int>& extraComp, Rectangle<int>& textAre
|
|||
}
|
||||
|
||||
if (extraComponent != nullptr)
|
||||
{
|
||||
extraComp = lf.getTabButtonExtraComponentBounds (*this, textArea, *extraComponent);
|
||||
|
||||
const TabbedButtonBar::Orientation orientation = owner.getOrientation();
|
||||
|
||||
if (orientation == TabbedButtonBar::TabsAtLeft || orientation == TabbedButtonBar::TabsAtRight)
|
||||
{
|
||||
if (extraComp.getCentreY() > textArea.getCentreY())
|
||||
textArea.setBottom (jmin (textArea.getBottom(), extraComp.getY()));
|
||||
else
|
||||
textArea.setTop (jmax (textArea.getY(), extraComp.getBottom()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (extraComp.getCentreX() > textArea.getCentreX())
|
||||
textArea.setRight (jmin (textArea.getRight(), extraComp.getX()));
|
||||
else
|
||||
textArea.setLeft (jmax (textArea.getX(), extraComp.getRight()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle<int> TabBarButton::getTextArea() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue