aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar un1versal2015-10-27 11:19:05 +0000
committerGravatar un1versal2015-10-27 11:19:05 +0000
commitd02496ef721740c9a13d95df76ae6192f446275a (patch)
treef1cc1fd016d155a5dab49bba8ccb9b7e11fe9db0 /src
parentMerge pull request #1695 from blindsighttf2/connect_button (diff)
parentinput: Draw blank buffers on nickname restorations (diff)
downloadKVIrc-d02496ef721740c9a13d95df76ae6192f446275a.tar.gz
KVIrc-d02496ef721740c9a13d95df76ae6192f446275a.tar.bz2
KVIrc-d02496ef721740c9a13d95df76ae6192f446275a.zip
Merge pull request #1694 from blindsighttf2/spellcheck
input: Draw blank buffers on nickname restorations
Diffstat (limited to 'src')
-rw-r--r--src/kvirc/ui/KviInputEditor.cpp12
-rw-r--r--src/kvirc/ui/KviInputEditor.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/src/kvirc/ui/KviInputEditor.cpp b/src/kvirc/ui/KviInputEditor.cpp
index 065ea3af0..a7f07e9e7 100644
--- a/src/kvirc/ui/KviInputEditor.cpp
+++ b/src/kvirc/ui/KviInputEditor.cpp
@@ -128,6 +128,7 @@ KviInputEditor::KviInputEditor(QWidget * pPar, KviWindow * pWnd, KviUserListView
m_pHistory = new KviPointerList<QString>;
m_pHistory->setAutoDelete(true);
m_bReadOnly = false;
+ m_bIsSpellcheckKey = false;
m_pUndoStack = NULL;
m_pRedoStack = NULL;
@@ -599,9 +600,17 @@ void KviInputEditor::drawContents(QPainter * p)
#else
m_szTextDisplayBuffer = m_szTextBuffer;
#endif
- m_bTextDisplayBufferDirty = false;
+ /* Draw blank buffers if it's a nick restoration and not spell check! */
+ if(m_bLastCompletionFinished && !m_bIsSpellcheckKey)
+ m_bTextDisplayBufferDirty = false;
}
+ // We don't need to know anymore, so set it to false. We use this as a way to
+ // determine if the spell check key was pressed. If it wasn't then we are good
+ // to draw a blank buffer. There are probably better, more efficient and complex
+ // ways to solve this problem but this seems to be the simplest solution.
+ m_bIsSpellcheckKey = false;
+
int iTop = KVI_INPUT_XTRAPADDING;
int iBottom = rect.height() - KVI_INPUT_XTRAPADDING;
@@ -1263,6 +1272,7 @@ void KviInputEditor::fillSpellCheckerCorrectionsPopup()
void KviInputEditor::showSpellCheckerCorrectionsPopup()
{
+ m_bIsSpellcheckKey = true;
fillSpellCheckerCorrectionsPopup();
int iXPos = xPositionFromCharIndex(m_iCursorPosition);
diff --git a/src/kvirc/ui/KviInputEditor.h b/src/kvirc/ui/KviInputEditor.h
index fcc44921c..cd8131341 100644
--- a/src/kvirc/ui/KviInputEditor.h
+++ b/src/kvirc/ui/KviInputEditor.h
@@ -171,6 +171,7 @@ protected:
QMenu * m_pIconMenu;
QMenu m_SpellCheckerPopup;
bool m_bReadOnly;
+ bool m_bIsSpellcheckKey;
/**
* \class EditCommand