Skip to content

Commit

Permalink
Add about panel section for Corporate Sponsors, add Jet Brains to cor…
Browse files Browse the repository at this point in the history
…porate list
  • Loading branch information
alcomposer committed Dec 5, 2024
1 parent 8fbbf42 commit cc5ba22
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions Source/Dialogs/AboutPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ class AboutPanel : public Component {
{ "tomara-x", "Documentation, testing" }
};

StringArray const sponsors = {
StringArray const corporateSponsors = {
"Deskew Technologies",
"Jet Brains"
};

StringArray const sponsors = {
"Naskomusic",
"epsil0ndelta",
"polarity",
Expand Down Expand Up @@ -94,7 +98,7 @@ class AboutPanel : public Component {

Path firstShadowPath;
firstShadowPath.addRoundedRectangle(Rectangle<int>(bounds.getX(), bounds.getY(), bounds.getWidth(), contributors.size() * 48).reduced(4), Corners::largeCornerRadius);
StackShadow::renderDropShadow(hash("credits_panel"), g, firstShadowPath, Colour(0, 0, 0).withAlpha(0.32f), 8);
StackShadow::renderDropShadow(hash("contributors"), g, firstShadowPath, Colour(0, 0, 0).withAlpha(0.32f), 8);

for (int i = 0; i < contributors.size(); i++) {
auto rowBounds = bounds.removeFromTop(48);
Expand All @@ -116,13 +120,41 @@ class AboutPanel : public Component {

bounds.removeFromTop(24);

Fonts::drawStyledText(g, "Sponsors", bounds.getX(), bounds.getY() - 8, bounds.getWidth(), 15.0f, findColour(PlugDataColour::panelTextColourId), Semibold, 15.0f);
Fonts::drawStyledText(g, "Corporate sponsors", bounds.getX(), bounds.getY() - 8, bounds.getWidth(), 15.0f, findColour(PlugDataColour::panelTextColourId), Semibold, 15.0f);

bounds.removeFromTop(16);

Path secondShadowPath;
secondShadowPath.addRoundedRectangle(Rectangle<int>(bounds.getX(), bounds.getY(), bounds.getWidth(), sponsors.size() * 32).reduced(4), Corners::largeCornerRadius);
StackShadow::renderDropShadow(hash("credits_panel"), g, secondShadowPath, Colour(0, 0, 0).withAlpha(0.32f), 8);
secondShadowPath.addRoundedRectangle(Rectangle<int>(bounds.getX(), bounds.getY(), bounds.getWidth(), corporateSponsors.size() * 32).reduced(4), Corners::largeCornerRadius);
StackShadow::renderDropShadow(hash("corporate_credits_panel"), g, secondShadowPath, Colour(0, 0, 0).withAlpha(0.32f), 8);
for (int i = 0; i < corporateSponsors.size(); i++) {
auto rowBounds = bounds.removeFromTop(36);
auto first = i == 0;
auto last = i == (corporateSponsors.size() - 1);
auto& name = corporateSponsors[i];
Path outline;
outline.addRoundedRectangle(rowBounds.getX(), rowBounds.getY(), rowBounds.getWidth(), rowBounds.getHeight(), Corners::largeCornerRadius, Corners::largeCornerRadius, first, first, last, last);

g.setColour(findColour(PlugDataColour::panelForegroundColourId));
g.fillPath(outline);

g.setColour(findColour(PlugDataColour::outlineColourId));
g.strokePath(outline, PathStrokeType(1));

Fonts::drawText(g, name, rowBounds.reduced(12, 2), findColour(PlugDataColour::panelTextColourId), 15);

jassert(!bounds.isEmpty());
}

bounds.removeFromTop(24);

Fonts::drawStyledText(g, "Sponsors", bounds.getX(), bounds.getY() - 8, bounds.getWidth(), 15.0f, findColour(PlugDataColour::panelTextColourId), Semibold, 15.0f);

bounds.removeFromTop(16);

Path thirdShadowPath;
thirdShadowPath.addRoundedRectangle(Rectangle<int>(bounds.getX(), bounds.getY(), bounds.getWidth(), sponsors.size() * 32).reduced(4), Corners::largeCornerRadius);
StackShadow::renderDropShadow(hash("credits_panel"), g, thirdShadowPath, Colour(0, 0, 0).withAlpha(0.32f), 8);
for (int i = 0; i < sponsors.size(); i++) {
auto rowBounds = bounds.removeFromTop(36);
auto first = i == 0;
Expand All @@ -145,7 +177,7 @@ class AboutPanel : public Component {

int getDesiredHeight()
{
return sponsors.size() * 36;
return (sponsors.size() + corporateSponsors.size() + 1) * 36;
}
};

Expand Down

0 comments on commit cc5ba22

Please sign in to comment.