forked from qt-creator/qt-creator
TextEditors: Generalize update mechanism when editors become visible
Generalizes the special handling of font settings, which should only be applied (on the document) when an editor is or becomes visible. Change-Id: Icd1e3ba4355e1ff4a837c9679b537cc3f5ed7ea9 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -272,16 +272,15 @@ void BaseTextDocument::setFontSettings(const FontSettings &fontSettings)
|
||||
emit fontSettingsChanged();
|
||||
}
|
||||
|
||||
void BaseTextDocument::ensureFontSettingsApplied()
|
||||
void BaseTextDocument::triggerPendingUpdates()
|
||||
{
|
||||
if (!d->m_fontSettingsNeedsApply)
|
||||
return;
|
||||
d->m_fontSettingsNeedsApply = false;
|
||||
applyFontSettings();
|
||||
if (d->m_fontSettingsNeedsApply)
|
||||
applyFontSettings();
|
||||
}
|
||||
|
||||
void BaseTextDocument::applyFontSettings()
|
||||
{
|
||||
d->m_fontSettingsNeedsApply = false;
|
||||
if (d->m_highlighter) {
|
||||
d->m_highlighter->setFontSettings(d->m_fontSettings);
|
||||
d->m_highlighter->rehighlight();
|
||||
|
||||
Reference in New Issue
Block a user