Browse Source

Projucer: Resize PropertyComponent items in PropertyGroupComponent to be centred with preferred height

tags/2021-05-28
ed 8 years ago
parent
commit
180399008c
1 changed files with 5 additions and 6 deletions
  1. +5
    -6
      extras/Projucer/Source/Project/jucer_ConfigTree_Base.h

+ 5
- 6
extras/Projucer/Source/Project/jucer_ConfigTree_Base.h View File

@@ -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…
Cancel
Save