Skip to content

Commit

Permalink
Small layout fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Dec 3, 2024
1 parent 3103e67 commit 5ece471
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Source/Dialogs/PatchStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ class PatchDisplay : public Component {
auto textColour = findColour(PlugDataColour::panelTextColourId);
Fonts::drawText(g, "by " + info.author, nameArea.withTrimmedLeft(10), textColour, 13.5f, Justification::left);

auto textBounds = b.reduced(10);
auto textBounds = b.reduced(10, 4);

Fonts::drawStyledText(g, info.title, textBounds.removeFromTop(22), textColour, Bold, 15, Justification::left);
Fonts::drawStyledText(g, info.title, textBounds.removeFromTop(30), textColour, Bold, 15, Justification::left);

auto layout = TextLayout();
auto description = AttributedString(info.description);
description.setFont(Font(14.5f));
description.setColour(textColour);
layout.createLayout(description, 240, 150);
layout.createLayout(description, textBounds.getWidth(), 150);

layout.draw(g, textBounds.withTrimmedBottom(32).toFloat());

Expand Down Expand Up @@ -370,7 +370,7 @@ class PatchContainer : public Component
addAndMakeVisible(display);
}

setSize(getWidth(), ((patches.size() / (getWidth() / displayWidth)) * displayHeight) + 12);
setSize(getWidth(), ((patches.size() / (getWidth() / displayWidth)) * (displayHeight + 8)) + 12);
resized(); // Even if size if the same, we still want to call resize
}

Expand Down Expand Up @@ -410,6 +410,7 @@ class PatchContainer : public Component
continue;

if (currentRow.getWidth() < displayWidth) {
bounds.removeFromTop(8);
currentRow = bounds.removeFromTop(displayHeight);
}

Expand Down Expand Up @@ -539,7 +540,7 @@ class PatchFullDisplay : public Component, public DownloadPool::DownloadListener
showPatch(patch, patches);
};

setSize(840, 1064);
setSize(840, 1180);

viewport.setScrollBarsShown(true, false);
viewport.setViewedComponent(this, false);
Expand Down Expand Up @@ -694,7 +695,7 @@ class PatchFullDisplay : public Component, public DownloadPool::DownloadListener
g.drawText(currentPatch.title, contentArea.removeFromTop(40), Justification::centredLeft);

g.setFont(Fonts::getCurrentFont().withHeight(16.5f));
g.drawText("by " + currentPatch.author, contentArea.removeFromTop(30), Justification::centredLeft);
g.drawText("by " + currentPatch.author, contentArea.removeFromTop(24), Justification::centredLeft);

contentArea.removeFromTop(8);

Expand Down

0 comments on commit 5ece471

Please sign in to comment.