Logo Search packages:      
Sourcecode: ibus-table version File versions  Download package

def table::tabengine::_update_preedit (   self  )  [private]

Update Preedit String in UI

Definition at line 1023 of file table.py.

01023                               :
        '''Update Preedit String in UI'''
        _str = self._editor.get_preedit_strings ()
        if _str == u'':
            self.update_preedit (u'', None, 0, False)
        else:
            attrs = ibus.AttrList()
            res = patt_edit.match (_str)
            if res:
                _str = u''
                ures = patt_uncommit.match (res.group(1))
                if ures:
                    _str=u''.join (ures.groups())
                    lc = len (ures.group(1) )
                    lu = len (ures.group(2) )
                    attrs.append (ibus.AttributeForeground(0x1b3f03,0,lc) )
                    attrs.append (ibus.AttributeForeground(0x0895a2,lc,lu) )
                    lg1 = len (_str)
                else:
                    _str += res.group (1)
                    lg1 = len ( res.group(1) )
                    attrs.append (ibus.AttributeForeground(0x1b3f03,0,lg1) )
                _str += res.group(2)
                _str += res.group(3)
                lg2 = len ( res.group(2) )
                lg3 = len ( res.group(3) )
                attrs.append( ibus.AttributeForeground(0x0e0ea0,lg1,lg2) )
                attrs.append( ibus.AttributeForeground(0x1b3f03,lg1+lg2,lg3) )
            else:
                attrs.append( ibus.AttributeForeground(0x1b3f03,0,len(_str)) )
            # because ibus now can only insert preedit into txt, so...
            attrs = ibus.AttrList()
            attrs.append(ibus.AttributeUnderline(ibus.ATTR_UNDERLINE_SINGLE, 0, len(_str)))


            self.update_preedit (_str, attrs, self._editor.get_caret(), True)
    
    def _update_aux (self):


Generated by  Doxygen 1.6.0   Back to index