//==============================================================================
void InterfaceComponent::addLabel (juce::Label& label,
                                   const juce::String& text,
                                   const juce::String& tooltip)
{
    label.setText (text, juce::NotificationType::dontSendNotification);
    label.setTooltip (tooltip);
    label.setFont (juce::Font (15.0f, juce::Font::plain));
    label.setJustificationType (juce::Justification::centredRight);
    label.setEditable (false, false, false);
    label.setColour (juce::Label::textColourId, juce::Colours::white);
    label.setColour (juce::Label::backgroundColourId, juce::Colour (juce::Colours::transparentBlack));

    addAndMakeVisible (&label);
    labelList.add (&label);
}
예제 #2
0
void MainContentComponent::SetLabelSettings(juce::Label& label_to_set) {
  label_to_set.setFont(juce::Font{12.f, juce::Font::bold});
  label_to_set.setEditable(false);
  label_to_set.setColour(juce::Label::textColourId, juce::Colours::darkgrey);
}
void NTLookAndFeel::drawLabel(juce::Graphics &g, juce::Label &label){
    g.fillAll (label.findColour (Label::backgroundColourId));
    
    if (! label.isBeingEdited())
    {
        const float alpha = label.isEnabled() ? 1.0f : 0.5f;
        const Font font (getLabelFont (label));
        
        g.setColour (label.findColour (Label::textColourId).withMultipliedAlpha (alpha));
        g.setFont (font);
        
        Rectangle<int> textArea (label.getBorderSize().subtractedFrom (label.getLocalBounds()));
        
        g.drawFittedText (label.getText(), textArea, label.getJustificationType(),
                          jmax (1, (int) (textArea.getHeight() / font.getHeight())),
                          label.getMinimumHorizontalScale());
        
        g.setColour (label.findColour (Label::outlineColourId).withMultipliedAlpha (alpha));
    }
    else if (label.isEnabled())
    {
        g.setColour (label.findColour (Label::outlineColourId));
    }
    
    g.drawRect (label.getLocalBounds(),2);
}