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:
parent
29320a01cc
commit
ed0c032a01
2 changed files with 6 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -684,6 +684,7 @@ private:
|
|||
bool menuActive;
|
||||
bool valueTextNeedsUpdating;
|
||||
bool consumeEscAndReturnKeys;
|
||||
bool styleChanged;
|
||||
|
||||
UndoManager undoManager;
|
||||
ScopedPointer<CaretComponent> caret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue