From f0a9fb9d481eedcf6efe835b59148118fd69a9e9 Mon Sep 17 00:00:00 2001 From: EvilDragon Date: Mon, 15 Nov 2021 02:37:16 +0100 Subject: [PATCH] About: finished clipboard button look and fixed URLs (#5403) --- src/surge-xt/gui/overlays/AboutScreen.cpp | 56 +++++++++++++++++++++-- src/surge-xt/gui/overlays/AboutScreen.h | 4 +- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/src/surge-xt/gui/overlays/AboutScreen.cpp b/src/surge-xt/gui/overlays/AboutScreen.cpp index f229c31c670..b41334d2124 100644 --- a/src/surge-xt/gui/overlays/AboutScreen.cpp +++ b/src/surge-xt/gui/overlays/AboutScreen.cpp @@ -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; @@ -190,9 +213,9 @@ void AboutScreen::resized() auto colW = 66; auto font = Surge::GUI::getFontManager()->getLatoAtSize(10); - copyButton = std::make_unique(); - copyButton->setButtonText("Copy Version Info"); - copyButton->setBounds(margin + 4, h0 - lHeight - 10, 100, 20); + copyButton = std::make_unique(); + copyButton->setSkin(skin, associatedBitmapStore); + copyButton->setBounds(margin + 4, h0 - lHeight - 4, 80, 16); copyButton->addListener(this); addAndMakeVisible(*copyButton); @@ -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", @@ -335,10 +374,10 @@ void AboutScreen::resized() std::vector 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; @@ -379,6 +418,13 @@ void AboutScreen::onSkinChanged() { logo = associatedBitmapStore->getImage(IDB_ABOUT_BG); + auto skcb = dynamic_cast(copyButton.get()); + + if (skcb) + { + skcb->setSkin(skin, associatedBitmapStore); + } + for (const auto &l : labels) { auto skc = dynamic_cast(l.get()); diff --git a/src/surge-xt/gui/overlays/AboutScreen.h b/src/surge-xt/gui/overlays/AboutScreen.h index d37a7a3c067..080861c5d60 100644 --- a/src/surge-xt/gui/overlays/AboutScreen.h +++ b/src/surge-xt/gui/overlays/AboutScreen.h @@ -27,6 +27,8 @@ namespace Surge { namespace Overlays { +struct ClipboardCopyButton; + struct AboutScreen : public juce::Component, public Surge::GUI::SkinConsumingComponent, public juce::Button::Listener @@ -64,7 +66,7 @@ struct AboutScreen : public juce::Component, std::vector> buttons; std::vector> icons; - std::unique_ptr copyButton; + std::unique_ptr copyButton; juce::Colour fillColour{juce::Colour(0, 0, 0).withAlpha(0.85f)};