# HG changeset patch # User Goffi # Date 1553758931 -3600 # Node ID 44752e8031f84f8fd5ba2d9af745ee5ad6640428 # Parent 5d96bcd3bfecbc63c6825772ed3586168812c052 simple XHTML: fixed crash when parent is set to None + fixed bold restoration when escaped message is modified diff -r 5d96bcd3bfec -r 44752e8031f8 cagou/core/simple_xhtml.py --- a/cagou/core/simple_xhtml.py Wed Mar 27 22:22:51 2019 +0100 +++ b/cagou/core/simple_xhtml.py Thu Mar 28 08:42:11 2019 +0100 @@ -41,7 +41,8 @@ class SimpleXHTMLWidgetEscapedText(Label): def on_parent(self, instance, parent): - self.font_size = parent.font_size + if parent is not None: + self.font_size = parent.font_size def _addUrlMarkup(self, text): text_elts = [] @@ -152,12 +153,12 @@ def on_xhtml(self, instance, xhtml): """parse xhtml and set content accordingly - if xhtml is an instance of Escape, a Label with not markup - will be used + if xhtml is an instance of Escape, a Label with no markup will be used """ self.clear_widgets() if isinstance(xhtml, Escape): - label = SimpleXHTMLWidgetEscapedText(text=xhtml, color=self.color) + label = SimpleXHTMLWidgetEscapedText( + text=xhtml, color=self.color, bold=self.bold) self.bind(color=label.setter('color')) self.bind(bold=label.setter('bold')) self.add_widget(label)