Skip to content

Commit

Permalink
fix MidiEditArea combo boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed Jan 22, 2024
1 parent 6858767 commit b4c8b30
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 168 deletions.
12 changes: 8 additions & 4 deletions Source/LumatoneEditorLookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
Label* label = new Label(sld.getName() + "_ValueLabel");
label->setText(String(sld.getValue()), dontSendNotification);
label->setJustificationType(Justification::centred);
// label->setFont(getAppFont(LumatoneEditorFont::GothamNarrowMedium));
label->setFont(getAppFont(LumatoneEditorFont::GothamNarrowMedium));

Colour textColour = (sld.isEnabled())
? findColour(LumatoneEditorColourIDs::DescriptionText)
Expand Down Expand Up @@ -820,8 +820,10 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
for (auto prop : box.getProperties())
l->getProperties().set(prop.name, prop.value);

auto name = box.getName();
auto fontHeight = box.getHeight() * CONTROLBOXFONTHEIGHTSCALAR;
l->setBounds(box.getLocalBounds());
l->setFont(getComboBoxFont(box).withHeight(box.getHeight() * CONTROLBOXFONTHEIGHTSCALAR)); // Any style overrides should have been passed to Label
l->setFont(getComboBoxFont(box)); // Any style overrides should have been passed to Label

return l;
}
Expand All @@ -832,8 +834,10 @@ class LumatoneEditorLookAndFeel : public LookAndFeel_V4
float fontHeight = labelToPosition.getFont().getHeight();

labelToPosition.setBounds(
margin, roundToInt((box.getHeight() - fontHeight) * 0.5f),
box.getWidth() - box.getHeight() - margin, fontHeight
margin
, (box.getHeight() - fontHeight) * 0.5
, box.getWidth() - box.getHeight() - margin /* leave room for down arrow glyph */
, fontHeight
);
}

Expand Down
Loading

0 comments on commit b4c8b30

Please sign in to comment.