textbuttonStyle.cpp (785B)
1 #include "textbuttonStyle.h" 2 3 namespace genericUI 4 { 5 void TextButtonStyle::drawButtonBackground(juce::Graphics& _graphics, juce::Button& _button, const juce::Colour& backgroundColour, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) 6 { 7 if(m_bgColor.getAlpha()) 8 _graphics.fillAll(m_bgColor); 9 } 10 11 juce::Font TextButtonStyle::getTextButtonFont(juce::TextButton& _textButton, int buttonHeight) 12 { 13 if (const auto f = getFont()) 14 return *f; 15 return UiObjectStyle::getTextButtonFont(_textButton, buttonHeight); 16 } 17 18 void TextButtonStyle::apply(juce::Button& _target) const 19 { 20 _target.setColour(juce::TextButton::ColourIds::textColourOffId, m_color); 21 _target.setColour(juce::TextButton::ColourIds::textColourOnId, m_color); 22 _target.setButtonText(m_text); 23 } 24 }