mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added a LookAndFeel method to modify Label borders
This commit is contained in:
parent
27349eaed1
commit
0165e066b2
4 changed files with 11 additions and 4 deletions
|
|
@ -67,13 +67,13 @@ public:
|
|||
/** Returns the gap that should be left at the top of the region. */
|
||||
ValueType getTop() const noexcept { return top; }
|
||||
|
||||
/** Returns the gap that should be left at the top of the region. */
|
||||
/** Returns the gap that should be left at the left of the region. */
|
||||
ValueType getLeft() const noexcept { return left; }
|
||||
|
||||
/** Returns the gap that should be left at the top of the region. */
|
||||
/** Returns the gap that should be left at the bottom of the region. */
|
||||
ValueType getBottom() const noexcept { return bottom; }
|
||||
|
||||
/** Returns the gap that should be left at the top of the region. */
|
||||
/** Returns the gap that should be left at the right of the region. */
|
||||
ValueType getRight() const noexcept { return right; }
|
||||
|
||||
/** Returns the sum of the top and bottom gaps. */
|
||||
|
|
|
|||
|
|
@ -1243,7 +1243,7 @@ void LookAndFeel_V2::drawLabel (Graphics& g, Label& label)
|
|||
g.setColour (label.findColour (Label::textColourId).withMultipliedAlpha (alpha));
|
||||
g.setFont (font);
|
||||
|
||||
auto textArea = label.getBorderSize().subtractedFrom (label.getLocalBounds());
|
||||
auto textArea = getLabelBorderSize (label).subtractedFrom (label.getLocalBounds());
|
||||
|
||||
g.drawFittedText (label.getText(), textArea, label.getJustificationType(),
|
||||
jmax (1, (int) (textArea.getHeight() / font.getHeight())),
|
||||
|
|
@ -1259,6 +1259,11 @@ void LookAndFeel_V2::drawLabel (Graphics& g, Label& label)
|
|||
g.drawRect (label.getLocalBounds());
|
||||
}
|
||||
|
||||
BorderSize<int> LookAndFeel_V2::getLabelBorderSize (Label& label)
|
||||
{
|
||||
return label.getBorderSize();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void LookAndFeel_V2::drawLinearSliderBackground (Graphics& g, int x, int y, int width, int height,
|
||||
float /*sliderPos*/,
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@ public:
|
|||
//==============================================================================
|
||||
void drawLabel (Graphics&, Label&) override;
|
||||
Font getLabelFont (Label&) override;
|
||||
BorderSize<int> getLabelBorderSize (Label&) override;
|
||||
|
||||
//==============================================================================
|
||||
void drawLinearSlider (Graphics&, int x, int y, int width, int height,
|
||||
|
|
|
|||
|
|
@ -280,6 +280,7 @@ public:
|
|||
|
||||
virtual void drawLabel (Graphics&, Label&) = 0;
|
||||
virtual Font getLabelFont (Label&) = 0;
|
||||
virtual BorderSize<int> getLabelBorderSize (Label&) = 0;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue