mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Tab button fix and minor clean-ups.
This commit is contained in:
parent
af9e993e12
commit
b8f557b201
6 changed files with 16 additions and 22 deletions
|
|
@ -124,10 +124,9 @@ void DropShadow::drawForPath (Graphics& g, const Path& path) const
|
|||
{
|
||||
jassert (radius > 0);
|
||||
|
||||
const Rectangle<int> area (path.getBounds().translated ((float) offset.x, (float) offset.y)
|
||||
.getSmallestIntegerContainer()
|
||||
.getIntersection (g.getClipBounds())
|
||||
.expanded (radius + 1, radius + 1));
|
||||
const Rectangle<int> area ((path.getBounds().getSmallestIntegerContainer() + offset)
|
||||
.getIntersection (g.getClipBounds())
|
||||
.expanded (radius + 1, radius + 1));
|
||||
|
||||
if (area.getWidth() > 2 && area.getHeight() > 2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ public:
|
|||
/** Destructor. */
|
||||
~ArrowButton();
|
||||
|
||||
|
||||
protected:
|
||||
/** @internal */
|
||||
void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown);
|
||||
|
||||
|
|
|
|||
|
|
@ -89,9 +89,9 @@ void ShapeButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButto
|
|||
isButtonDown = false;
|
||||
}
|
||||
|
||||
g.setColour ((isButtonDown) ? downColour
|
||||
: (isMouseOverButton) ? overColour
|
||||
: normalColour);
|
||||
g.setColour (isButtonDown ? downColour
|
||||
: isMouseOverButton ? overColour
|
||||
: normalColour);
|
||||
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
|
|
|
|||
|
|
@ -87,11 +87,8 @@ public:
|
|||
float outlineStrokeWidth);
|
||||
|
||||
|
||||
protected:
|
||||
/** @internal */
|
||||
void paintButton (Graphics& g,
|
||||
bool isMouseOverButton,
|
||||
bool isButtonDown);
|
||||
void paintButton (Graphics&, bool isMouseOverButton, bool isButtonDown);
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -152,7 +152,10 @@ void TabBarButton::setExtraComponent (Component* comp, ExtraComponentPlacement p
|
|||
void TabBarButton::childBoundsChanged (Component* c)
|
||||
{
|
||||
if (c == extraComponent)
|
||||
{
|
||||
owner.resized();
|
||||
resized();
|
||||
}
|
||||
}
|
||||
|
||||
void TabBarButton::resized()
|
||||
|
|
@ -434,7 +437,6 @@ void TabbedButtonBar::resized()
|
|||
for (int i = 0; i < tabs.size(); ++i)
|
||||
{
|
||||
TabBarButton* const tb = tabs.getUnchecked(i)->button;
|
||||
|
||||
const int newLength = totalLength + tb->getBestTabLength (depth);
|
||||
|
||||
if (i > 0 && newLength * minimumScale > tabsButtonPos)
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ BubbleComponent::BubbleComponent()
|
|||
setComponentEffect (&shadow);
|
||||
}
|
||||
|
||||
BubbleComponent::~BubbleComponent()
|
||||
{
|
||||
}
|
||||
BubbleComponent::~BubbleComponent() {}
|
||||
|
||||
//==============================================================================
|
||||
void BubbleComponent::paint (Graphics& g)
|
||||
|
|
@ -43,13 +41,12 @@ void BubbleComponent::paint (Graphics& g)
|
|||
(float) content.getX(), (float) content.getY(),
|
||||
(float) content.getWidth(), (float) content.getHeight());
|
||||
|
||||
g.reduceClipRegion (content);
|
||||
g.setOrigin (content.getX(), content.getY());
|
||||
g.reduceClipRegion (0, 0, content.getWidth(), content.getHeight());
|
||||
|
||||
paintContent (g, content.getWidth(), content.getHeight());
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void BubbleComponent::setAllowedPlacement (const int newPlacement)
|
||||
{
|
||||
allowablePlacements = newPlacement;
|
||||
|
|
@ -82,9 +79,8 @@ void BubbleComponent::setPosition (const Rectangle<int>& rectangleToPointTo)
|
|||
content.setBounds (edgeSpace, edgeSpace, contentW, contentH);
|
||||
}
|
||||
|
||||
int totalW = content.getWidth() + edgeSpace * 2;
|
||||
int totalH = content.getHeight() + edgeSpace * 2;
|
||||
int targetX, targetY;
|
||||
const int totalW = content.getWidth() + edgeSpace * 2;
|
||||
const int totalH = content.getHeight() + edgeSpace * 2;
|
||||
|
||||
const Rectangle<int> availableSpace (getParentComponent() != nullptr ? getParentComponent()->getLocalBounds()
|
||||
: getParentMonitorArea());
|
||||
|
|
@ -106,6 +102,8 @@ void BubbleComponent::setPosition (const Rectangle<int>& rectangleToPointTo)
|
|||
spaceAbove = spaceBelow = 0;
|
||||
}
|
||||
|
||||
int targetX, targetY;
|
||||
|
||||
if (jmax (spaceAbove, spaceBelow) >= jmax (spaceLeft, spaceRight))
|
||||
{
|
||||
targetX = rectangleToPointTo.getCentre().x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue