From 996f44f3f6cf40c4362d7898231ac8829e0b0b9c Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 12 Oct 2017 12:29:58 +0100 Subject: [PATCH] Added set and getJustificationType() methods to HyperlinkButton --- modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp | 9 +++++++++ modules/juce_gui_basics/buttons/juce_HyperlinkButton.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp index acafad1ac8..1cf6085b83 100644 --- a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp @@ -82,6 +82,15 @@ void HyperlinkButton::changeWidthToFitText() setSize (getFontToUse().getStringWidth (getButtonText()) + 6, getHeight()); } +void HyperlinkButton::setJustificationType (Justification newJustification) +{ + if (justification != newJustification) + { + justification = newJustification; + repaint(); + } +} + void HyperlinkButton::colourChanged() { repaint(); diff --git a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h index 1b67e17d08..02d23d96aa 100644 --- a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h +++ b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h @@ -91,6 +91,15 @@ public: */ 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: //============================================================================== /** @internal */