Browse Source

Added set and getJustificationType() methods to HyperlinkButton

tags/2021-05-28
ed 7 years ago
parent
commit
996f44f3f6
2 changed files with 18 additions and 0 deletions
  1. +9
    -0
      modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp
  2. +9
    -0
      modules/juce_gui_basics/buttons/juce_HyperlinkButton.h

+ 9
- 0
modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp View File

@@ -82,6 +82,15 @@ void HyperlinkButton::changeWidthToFitText()
setSize (getFontToUse().getStringWidth (getButtonText()) + 6, getHeight()); setSize (getFontToUse().getStringWidth (getButtonText()) + 6, getHeight());
} }
void HyperlinkButton::setJustificationType (Justification newJustification)
{
if (justification != newJustification)
{
justification = newJustification;
repaint();
}
}
void HyperlinkButton::colourChanged() void HyperlinkButton::colourChanged()
{ {
repaint(); repaint();


+ 9
- 0
modules/juce_gui_basics/buttons/juce_HyperlinkButton.h View File

@@ -91,6 +91,15 @@ public:
*/ */
void changeWidthToFitText(); void changeWidthToFitText();
//==============================================================================
/** Sets the style of justification to be used for positioning the text.
(The default is Justification::centred)
*/
void setJustificationType (Justification justification);
/** Returns the type of justification, as set in setJustificationType(). */
Justification getJustificationType() const noexcept { return justification; }
protected: protected:
//============================================================================== //==============================================================================
/** @internal */ /** @internal */


Loading…
Cancel
Save