From d59ec0ceef22bf077cde2dfaed017c0ba49eaafa Mon Sep 17 00:00:00 2001 From: hogliux Date: Mon, 31 Jul 2017 14:37:23 +0100 Subject: [PATCH] AlertWindow: Fixed an issue with the AlertWindow's text block having incorrect colours --- .../juce_gui_basics/windows/juce_AlertWindow.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/juce_gui_basics/windows/juce_AlertWindow.cpp b/modules/juce_gui_basics/windows/juce_AlertWindow.cpp index 6bf97819e0..87983568c5 100644 --- a/modules/juce_gui_basics/windows/juce_AlertWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_AlertWindow.cpp @@ -215,6 +215,13 @@ class AlertTextComp : public TextEditor public: AlertTextComp (AlertWindow& owner, const String& message, const Font& font) { + if (owner.isColourSpecified (AlertWindow::textColourId)) + setColour (TextEditor::textColourId, owner.findColour (AlertWindow::textColourId)); + + setColour (TextEditor::backgroundColourId, Colours::transparentBlack); + setColour (TextEditor::outlineColourId, Colours::transparentBlack); + setColour (TextEditor::shadowColourId, Colours::transparentBlack); + setReadOnly (true); setMultiLine (true, true); setCaretVisible (false); @@ -226,13 +233,6 @@ public: setText (message, false); bestWidth = 2 * (int) std::sqrt (font.getHeight() * font.getStringWidth (message)); - - if (owner.isColourSpecified (AlertWindow::textColourId)) - setColour (TextEditor::textColourId, owner.findColour (AlertWindow::textColourId)); - - setColour (TextEditor::backgroundColourId, Colours::transparentBlack); - setColour (TextEditor::outlineColourId, Colours::transparentBlack); - setColour (TextEditor::shadowColourId, Colours::transparentBlack); } int getPreferredWidth() const noexcept { return bestWidth; }