Skip to content

Commit

Permalink
upgraded output toggle buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
hsetlik committed Apr 16, 2021
1 parent d70d350 commit 0495bb7
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions Source/CustomLnF.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,28 @@ class LnF2 : public juce::LookAndFeel_V4
class OutputButtonLnF : public juce::LookAndFeel_V4
{
public:
OutputButtonLnF()
juce::Font getTextButtonFont(juce::TextButton &, int buttonHeight) override
{
setDefaultSansSerifTypefaceName("");
return juce::Font("Bebas Neue", buttonHeight, 0);
}

juce::Font getTextButtonFont(juce::TextButton &, int buttonHeight) override
void drawButtonBackground (juce::Graphics &g, juce::Button &b, const juce::Colour &backgroundColour, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
{
return juce::Font("Bebas Neue", 15.0f, 0);
g.setColour(UXPalette::lightGray);
if(b.getToggleState())
g.setColour(UXPalette::lightRed);
g.fillRoundedRectangle(b.getLocalBounds().toFloat(), 6.0f);
}
void drawButtonText(juce::Graphics& g, juce::TextButton& t, bool shouldDrawHighlighted, bool shouldDrawDown) override
{
auto fBounds = t.getLocalBounds().toFloat();
auto str = t.getButtonText();
auto delta = fBounds.getHeight() / 8.0f;
fBounds = fBounds.reduced(delta);
g.setColour(juce::Colours::white);
g.setFont(getTextButtonFont(t, fBounds.getHeight()));
g.drawText(str, fBounds, juce::Justification::centred);
}

};

class TabbedButtonLnF : public juce::LookAndFeel_V4
Expand Down

0 comments on commit 0495bb7

Please sign in to comment.