1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a styleChanged flag to enable setText() to take effect after setColor()

This commit is contained in:
luigisambuy 2016-09-05 11:50:18 +01:00
parent 29320a01cc
commit ed0c032a01
2 changed files with 6 additions and 1 deletions

View file

@ -915,6 +915,7 @@ TextEditor::TextEditor (const String& name,
menuActive (false),
valueTextNeedsUpdating (false),
consumeEscAndReturnKeys (true),
styleChanged (false),
leftIndent (4),
topIndent (4),
lastTransactionTime (0),
@ -1080,6 +1081,7 @@ void TextEditor::colourChanged()
{
setOpaque (findColour (backgroundColourId).isOpaque());
repaint();
styleChanged = true;
}
void TextEditor::lookAndFeelChanged()
@ -1186,7 +1188,7 @@ void TextEditor::setText (const String& newText,
{
const int newLength = newText.length();
if (newLength != getTotalNumChars() || getText() != newText)
if (newLength != getTotalNumChars() || getText() != newText || styleChanged)
{
textValue = newText;
@ -1212,6 +1214,8 @@ void TextEditor::setText (const String& newText,
scrollToMakeSureCursorIsVisible();
undoManager.clearUndoHistory();
styleChanged = false;
repaint();
}
}

View file

@ -684,6 +684,7 @@ private:
bool menuActive;
bool valueTextNeedsUpdating;
bool consumeEscAndReturnKeys;
bool styleChanged;
UndoManager undoManager;
ScopedPointer<CaretComponent> caret;