Author: roidelapluie Date: 2008-08-13 13:21:39 +0200 (Wed, 13 Aug 2008) New Revision: 10225
Modified: trunk/src/htmltextview.py Log: improve CSS property text-decoration (allow multi text-decoration)
Modified: trunk/src/htmltextview.py =================================================================== --- trunk/src/htmltextview.py 2008-08-12 21:20:49 UTC (rev 10224) +++ trunk/src/htmltextview.py 2008-08-13 11:21:39 UTC (rev 10225) @@ -477,23 +477,22 @@ tag.set_property('justification', align) def _parse_style_text_decoration(self, tag, value): - if value == 'none': + values = value.split(' ') + if 'none' in values: tag.set_property('underline', pango.UNDERLINE_NONE) tag.set_property('strikethrough', False) - elif value == 'underline': + if 'underline' in values: tag.set_property('underline', pango.UNDERLINE_SINGLE) - tag.set_property('strikethrough', False) - elif value == 'overline': - warnings.warn('text-decoration:overline not implemented') + else: tag.set_property('underline', pango.UNDERLINE_NONE) - tag.set_property('strikethrough', False) - elif value == 'line-through': - tag.set_property('underline', pango.UNDERLINE_NONE) + if 'line-through' in values: tag.set_property('strikethrough', True) - elif value == 'blink': - warnings.warn('text-decoration:blink not implemented') else: - warnings.warn('text-decoration:%s not implemented' % value) + tag.set_property('strikethrough', False) + if 'blink' in values: + warnings.warn('text-decoration:blink not implemented') + if 'overline' in values: + warnings.warn('text-decoration:overline not implemented') def _parse_style_white_space(self, tag, value): if value == 'pre': @@ -1148,4 +1147,4 @@ w.connect('destroy', lambda w: gtk.main_quit()) gtk.main()
-# vim: se ts=3: \ No newline at end of file +# vim: se ts=3: