diff --git a/The-Orm/CurrentPatchDisplay.cpp b/The-Orm/CurrentPatchDisplay.cpp index 195916c8..0f60a311 100644 --- a/The-Orm/CurrentPatchDisplay.cpp +++ b/The-Orm/CurrentPatchDisplay.cpp @@ -16,6 +16,7 @@ #include "ColourHelpers.h" #include "LayoutConstants.h" #include "UIModel.h" +#include "FlexBoxHelper.h" #include @@ -154,7 +155,9 @@ void CurrentPatchDisplay::resized() fb.justifyContent = FlexBox::JustifyContent::center; fb.items.add(FlexItem(favorite_).withMinHeight(LAYOUT_LINE_HEIGHT).withMinWidth(LAYOUT_BUTTON_WIDTH_MIN)); fb.items.add(FlexItem(hide_).withMinHeight(LAYOUT_LINE_HEIGHT).withMinWidth(LAYOUT_BUTTON_WIDTH_MIN)); - fb.performLayout(nextRow); + auto spaceNeeded = FlexBoxHelper::determineSizeForButtonLayout(this, this, { &favorite_, &hide_ }, nextRow); + fb.performLayout(spaceNeeded.toNearestInt()); + area.removeFromTop((int) spaceNeeded.getHeight()); // Next row, Synth name. These lines are spaced only inset small apart as they are pure text nextRow = area.removeFromTop(LAYOUT_TEXT_LINE_SPACING).withTrimmedTop(LAYOUT_INSET_SMALL); diff --git a/The-Orm/PatchSearchComponent.cpp b/The-Orm/PatchSearchComponent.cpp index 98d020b8..7e23ee64 100644 --- a/The-Orm/PatchSearchComponent.cpp +++ b/The-Orm/PatchSearchComponent.cpp @@ -7,6 +7,8 @@ #include "PatchSearchComponent.h" #include "LayoutConstants.h" +#include "FlexBoxHelper.h" + #include "UIModel.h" const char* kAllDataTypesFilter = "All types"; @@ -121,7 +123,7 @@ void PatchSearchComponent::resized() fb.performLayout(favRow); auto filterRow = normalFilter; - auto catFilterMin = categoryFilters_.determineMinimumSize(this, filterRow.withTrimmedTop(LAYOUT_INSET_NORMAL)); + auto catFilterMin = categoryFilters_.determineSubAreaForButtonLayout(this, filterRow.withTrimmedTop(LAYOUT_INSET_NORMAL)); categoryFilters_.setBounds(catFilterMin.toNearestInt()); int normalFilterHeight = LAYOUT_LINE_HEIGHT + LAYOUT_INSET_NORMAL + categoryFilters_.getHeight(); diff --git a/juce-widgets b/juce-widgets index ae9b4964..b81c71a5 160000 --- a/juce-widgets +++ b/juce-widgets @@ -1 +1 @@ -Subproject commit ae9b49648be678a066d8e533c28bc010e2dc629a +Subproject commit b81c71a59175d6027a3c37acdc86fd9b7869e7a7