Skip to content

Commit

Permalink
Some minor part sidebar card ui spacing tweaks (#1148)
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul authored Aug 18, 2024
1 parent df60a5f commit 8961196
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src-ui/components/PlayScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct ViewportComponent : juce::Component, HasEditor
g.setColour(col);
auto bx =
playScreen->rectangleForPart(i).withTrimmedBottom(PlayScreen::interPartMargin);
g.drawRect(bx, 1);
g.drawRoundedRectangle(bx.toFloat(), 2, 1);
g.drawVerticalLine(bx.getX() + multi::PartSidebarCard::width, bx.getY(),
bx.getY() + bx.getHeight());
}
Expand Down
10 changes: 6 additions & 4 deletions src-ui/components/multi/PartGroupSidebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ struct PartSidebar : juce::Component, HasEditor
}
void resized() override
{
viewport->setBounds(getLocalBounds());
auto w = getWidth() - viewport->getScrollBarThickness() - 2;
viewportContents->setBounds(0, 0, w, PartSidebarCard::height * scxt::numParts);
auto w = PartSidebarCard::width + viewport->getScrollBarThickness() + 2;
viewport->setBounds(getLocalBounds().withWidth(w).translated(3, 0));
viewportContents->setBounds(0, 0, PartSidebarCard::width,
PartSidebarCard::height * scxt::numParts);
for (int i = 0; i < scxt::numParts; ++i)
{
parts[i]->setBounds(0, i * PartSidebarCard::height, w, PartSidebarCard::height);
parts[i]->setBounds(0, i * PartSidebarCard::height, PartSidebarCard::width,
PartSidebarCard::height);
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions src-ui/components/multi/PartSidebarCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void PartSidebarCard::paint(juce::Graphics &g)
{
auto rb = getLocalBounds().reduced(1);

g.drawRect(rb);
g.drawRoundedRectangle(rb.toFloat(), 2, 1);
}
auto r = juce::Rectangle<int>(5, row0 + rowMargin, 18, rowHeight - 2 * rowMargin);
g.setFont(editor->themeApplier.interMediumFor(12));
Expand All @@ -136,7 +136,7 @@ void PartSidebarCard::paint(juce::Graphics &g)
r = r.translated(0, rowHeight);
jcmp::GlyphPainter::paintGlyph(g, r, jcmp::GlyphPainter::GlyphType::MIDI, med);
r = r.translated(0, rowHeight);
jcmp::GlyphPainter::paintGlyph(g, r, jcmp::GlyphPainter::GlyphType::VOLUME, med);
jcmp::GlyphPainter::paintGlyph(g, r, jcmp::GlyphPainter::GlyphType::SPEAKER, med);
r = r.translated(0, rowHeight);
jcmp::GlyphPainter::paintGlyph(g, r, jcmp::GlyphPainter::GlyphType::POLYPHONY, med);

Expand Down

0 comments on commit 8961196

Please sign in to comment.