summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2018-06-25 11:23:42 +0800
committerPeng Wu <alexepico@gmail.com>2018-06-25 11:23:42 +0800
commite6438371f64fcf3791f37e30f9a66f6282276961 (patch)
treeb42cda47a6349240be39027fc6e4512e3acb2517
parent0cb05c62b4e518abb2fc8a833f06c460bad9932e (diff)
downloadibus-libpinyin-e6438371f64fcf3791f37e30f9a66f6282276961.tar.gz
ibus-libpinyin-e6438371f64fcf3791f37e30f9a66f6282276961.tar.xz
ibus-libpinyin-e6438371f64fcf3791f37e30f9a66f6282276961.zip
write updateLookupTableFast method of class SuggestionEditor
-rw-r--r--src/PYPSuggestionEditor.cc24
-rw-r--r--src/PYPSuggestionEditor.h1
2 files changed, 21 insertions, 4 deletions
diff --git a/src/PYPSuggestionEditor.cc b/src/PYPSuggestionEditor.cc
index ea3dba0..27b07d1 100644
--- a/src/PYPSuggestionEditor.cc
+++ b/src/PYPSuggestionEditor.cc
@@ -217,7 +217,9 @@ void
SuggestionEditor::pageUp (void)
{
if (G_LIKELY (m_lookup_table.pageUp ())) {
- update ();
+ updateLookupTableFast ();
+ updatePreeditText ();
+ updateAuxiliaryText ();
}
}
@@ -225,7 +227,9 @@ void
SuggestionEditor::pageDown (void)
{
if (G_LIKELY (m_lookup_table.pageDown ())) {
- update ();
+ updateLookupTableFast ();
+ updatePreeditText ();
+ updateAuxiliaryText ();
}
}
@@ -233,7 +237,9 @@ void
SuggestionEditor::cursorUp (void)
{
if (G_LIKELY (m_lookup_table.cursorUp ())) {
- update ();
+ updateLookupTableFast ();
+ updatePreeditText ();
+ updateAuxiliaryText ();
}
}
@@ -241,7 +247,9 @@ void
SuggestionEditor::cursorDown (void)
{
if (G_LIKELY (m_lookup_table.cursorDown ())) {
- update ();
+ updateLookupTableFast ();
+ updatePreeditText ();
+ updateAuxiliaryText ();
}
}
@@ -263,6 +271,12 @@ SuggestionEditor::reset (void)
}
void
+SuggestionEditor::updateLookupTableFast (void)
+{
+ Editor::updateLookupTableFast (m_lookup_table, TRUE);
+}
+
+void
SuggestionEditor::updateLookupTable (void)
{
m_lookup_table.clear ();
@@ -275,6 +289,8 @@ SuggestionEditor::updateLookupTable (void)
Editor::updateLookupTableFast (m_lookup_table, TRUE);
} else {
hideLookupTable ();
+ /* clean up prefix */
+ m_text = "";
}
}
diff --git a/src/PYPSuggestionEditor.h b/src/PYPSuggestionEditor.h
index 8ad0a60..ed45c2f 100644
--- a/src/PYPSuggestionEditor.h
+++ b/src/PYPSuggestionEditor.h
@@ -58,6 +58,7 @@ protected:
private:
void updateLookupTable (void);
+ void updateLookupTableFast ();
gboolean updateCandidates ();
gboolean fillLookupTable ();
void updatePreeditText (void);