red text when type a mistake word in preedit mode
authorMr.LeQuocTuan <Mr.LeQuocTuan@79bd180b-0a32-48ee-ac55-ada8cae9df61>
Thu, 18 Jun 2009 06:47:40 +0000 (06:47 +0000)
committerMr.LeQuocTuan <Mr.LeQuocTuan@79bd180b-0a32-48ee-ac55-ada8cae9df61>
Thu, 18 Jun 2009 06:47:40 +0000 (06:47 +0000)
git-svn-id: svn://localhost/trunk@4 79bd180b-0a32-48ee-ac55-ada8cae9df61

src/scim_unikey_imengine.cpp

index e8336a3..1ea1298 100644 (file)
@@ -280,7 +280,19 @@ void UnikeyInstance::Unikey_send_backspace(int nBackspace)
 
 void UnikeyInstance::Unikey_update_preedit_string(const WideString s, const bool visible)
 {
-    update_preedit_string(s);
+    AttributeList list;
+    Attribute att;
+
+    att = Attribute(0, s.length(), SCIM_ATTR_DECORATE, SCIM_ATTR_DECORATE_REVERSE);
+    list.push_back(att);
+
+    if (m_ukopt.spellCheckEnabled==1 && UnikeyLastWordIsNonVn())
+    {
+        att = Attribute(0, s.length(), SCIM_ATTR_FOREGROUND, 0xff0000);
+        list.push_back(att);
+    }
+
+    update_preedit_string(s, list);
     update_preedit_caret(s.length());
 
     if (visible == true)