mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-13 00:04:19 +00:00
Projucer: Resize PropertyComponent items in PropertyGroupComponent to be centred with preferred height
This commit is contained in:
parent
50fdeba363
commit
180399008c
1 changed files with 5 additions and 6 deletions
|
|
@ -156,7 +156,7 @@ public:
|
|||
|
||||
pp->setBounds (40, height, width - 50, propertyHeight);
|
||||
|
||||
resizeContentIfChoicePropertyComponent (pp);
|
||||
resizePropertyComponent (pp);
|
||||
|
||||
height += pp->getHeight() + 10;
|
||||
}
|
||||
|
|
@ -184,14 +184,13 @@ public:
|
|||
return static_cast<int> (nameWidth / availableTextWidth);
|
||||
}
|
||||
|
||||
void resizeContentIfChoicePropertyComponent (PropertyComponent* pp)
|
||||
void resizePropertyComponent (PropertyComponent* pp)
|
||||
{
|
||||
if (auto* choiceComp = dynamic_cast<ChoicePropertyComponent*> (pp))
|
||||
if (auto* propertyChild = pp->getChildComponent (0))
|
||||
{
|
||||
auto* box = choiceComp->getChildComponent (0);
|
||||
auto bounds = box->getBounds();
|
||||
auto bounds = propertyChild->getBounds();
|
||||
|
||||
box->setBounds (bounds.withSizeKeepingCentre (box->getWidth(), pp->getPreferredHeight()));
|
||||
propertyChild->setBounds (bounds.withSizeKeepingCentre (propertyChild->getWidth(), pp->getPreferredHeight()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue