Skip to content

Commit

Permalink
About: finished clipboard button look and fixed URLs (#5403)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkruselj authored Nov 15, 2021
1 parent 57d267a commit f0a9fb9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 6 deletions.
56 changes: 51 additions & 5 deletions src/surge-xt/gui/overlays/AboutScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,29 @@ struct HyperlinkLabel : public juce::Label, public Surge::GUI::SkinConsumingComp
std::string url;
};

struct ClipboardCopyButton : public juce::TextButton, Surge::GUI::SkinConsumingComponent
{
ClipboardCopyButton() : juce::TextButton() {}

void paintButton(juce::Graphics &g, bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown) override
{
assert(skin.get());

if (isOver())
{
g.setColour(skin->getColor(Colors::AboutPage::LinkHover));
}
else
{
g.setColour(skin->getColor(Colors::AboutPage::Link));
}

g.setFont(Surge::GUI::getFontManager()->getLatoAtSize(10));
g.drawText("Copy Version Info", getLocalBounds(), juce::Justification::centred, false);
}
};

AboutScreen::AboutScreen() {}

AboutScreen::~AboutScreen() noexcept = default;
Expand Down Expand Up @@ -190,9 +213,9 @@ void AboutScreen::resized()
auto colW = 66;
auto font = Surge::GUI::getFontManager()->getLatoAtSize(10);

copyButton = std::make_unique<juce::TextButton>();
copyButton->setButtonText("Copy Version Info");
copyButton->setBounds(margin + 4, h0 - lHeight - 10, 100, 20);
copyButton = std::make_unique<ClipboardCopyButton>();
copyButton->setSkin(skin, associatedBitmapStore);
copyButton->setBounds(margin + 4, h0 - lHeight - 4, 80, 16);
copyButton->addListener(this);

addAndMakeVisible(*copyButton);
Expand Down Expand Up @@ -300,31 +323,47 @@ void AboutScreen::resized()
" by Vember Audio and individual contributors in the Surge Synth Team, released "
"under the GNU GPL v3 license",
600);

yp += lblvs;

addLabel("VST is a trademark of Steinberg Media Technologies GmbH;Audio Units is a "
"trademark of Apple Inc.",
600);

yp += lblvs;

addLabel("Airwindows open source effects by Chris Johnson, licensed under MIT license",
600);

yp += lblvs;

addLabel("OB-Xd filters by Vadim Filatov, licensed under GNU GPL v3 license", 600);

yp += lblvs;

addLabel("K35 and Diode Ladder filters by Will Pirkle (implementation by TheWaveWarden), "
"licensed under GNU GPL v3 license",
600);

yp += lblvs;

addLabel("Cutoff Warp and Resonance Warp filters; CHOW, Neuron and Tape effects by Jatin "
"Chowdhury, licensed under GNU GPL v3 license",
600);

yp += lblvs;

addLabel(
"Exciter effect and BBD delay line emulation by Jatin Chowdhury, licensed under BSD "
"3-clause license",
600);

yp += lblvs;

addLabel("OJD waveshaper by Janos Buttgereit, licensed under GNU GPL v3 license", 600);

yp += lblvs;

addLabel(
"Nimbus effect and Twist oscillator based on firmware for Eurorack hardware modules "
"by Émilie Gillet, licensed under MIT license",
Expand All @@ -335,10 +374,10 @@ void AboutScreen::resized()

std::vector<std::string> urls = {
"https://github.com/surge-synthesizer/surge/",
"https://discord.gg/aFQDdMV",
"https://www.gnu.org/licenses/gpl-3.0-standalone.html",
"https://www.steinberg.net/en/company/technologies/vst3.html",
"https://developer.apple.com/documentation/audiounit",
"https://www.gnu.org/licenses/gpl-3.0-standalone.html",
"https://discord.gg/aFQDdMV",
"https://juce.com"};

int x = 0;
Expand Down Expand Up @@ -379,6 +418,13 @@ void AboutScreen::onSkinChanged()
{
logo = associatedBitmapStore->getImage(IDB_ABOUT_BG);

auto skcb = dynamic_cast<Surge::GUI::SkinConsumingComponent *>(copyButton.get());

if (skcb)
{
skcb->setSkin(skin, associatedBitmapStore);
}

for (const auto &l : labels)
{
auto skc = dynamic_cast<Surge::GUI::SkinConsumingComponent *>(l.get());
Expand Down
4 changes: 3 additions & 1 deletion src/surge-xt/gui/overlays/AboutScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ namespace Surge
{
namespace Overlays
{
struct ClipboardCopyButton;

struct AboutScreen : public juce::Component,
public Surge::GUI::SkinConsumingComponent,
public juce::Button::Listener
Expand Down Expand Up @@ -64,7 +66,7 @@ struct AboutScreen : public juce::Component,
std::vector<std::unique_ptr<juce::Button>> buttons;
std::vector<std::unique_ptr<juce::Component>> icons;

std::unique_ptr<juce::Button> copyButton;
std::unique_ptr<ClipboardCopyButton> copyButton;

juce::Colour fillColour{juce::Colour(0, 0, 0).withAlpha(0.85f)};

Expand Down

0 comments on commit f0a9fb9

Please sign in to comment.