Skip to content

Commit

Permalink
Bugfix: Prevent the import texts from overlapping a wrapped flex box …
Browse files Browse the repository at this point in the history
…layout for Fav and Hide buttons, and use the new FlexBoxHelper.
  • Loading branch information
christofmuc committed Jun 8, 2021
1 parent 99441a5 commit 2d5e671
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion The-Orm/CurrentPatchDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "ColourHelpers.h"
#include "LayoutConstants.h"
#include "UIModel.h"
#include "FlexBoxHelper.h"

#include <boost/format.hpp>

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion The-Orm/PatchSearchComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "PatchSearchComponent.h"

#include "LayoutConstants.h"
#include "FlexBoxHelper.h"

#include "UIModel.h"

const char* kAllDataTypesFilter = "All types";
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion juce-widgets

0 comments on commit 2d5e671

Please sign in to comment.