From 5ece4716aff15b4ba6fd5cd406d2d0091c7ccdd1 Mon Sep 17 00:00:00 2001 From: Timothy Schoen Date: Wed, 4 Dec 2024 00:49:30 +0100 Subject: [PATCH] Small layout fixes --- Source/Dialogs/PatchStore.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Dialogs/PatchStore.h b/Source/Dialogs/PatchStore.h index 0e8c0a402..67e2c19ed 100644 --- a/Source/Dialogs/PatchStore.h +++ b/Source/Dialogs/PatchStore.h @@ -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()); @@ -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 } @@ -410,6 +410,7 @@ class PatchContainer : public Component continue; if (currentRow.getWidth() < displayWidth) { + bounds.removeFromTop(8); currentRow = bounds.removeFromTop(displayHeight); } @@ -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); @@ -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);