diff cagou/core/simple_xhtml.py @ 185:ab3f5173ef5c

chat, simple XHTML: font size adjustement
author Goffi <goffi@goffi.org>
date Fri, 11 May 2018 20:07:17 +0200
parents cd99f70ea592
children 1b835bcfa663
line wrap: on
line diff
--- a/cagou/core/simple_xhtml.py	Thu May 10 08:32:46 2018 +0200
+++ b/cagou/core/simple_xhtml.py	Fri May 11 20:07:17 2018 +0200
@@ -23,6 +23,7 @@
 from kivy.uix.stacklayout import StackLayout
 from kivy.uix.label import Label
 from kivy.utils import escape_markup
+from kivy.metrics import sp
 from kivy import properties
 from xml.etree import ElementTree as ET
 from sat_frontends.tools import css_color, strings as sat_strings
@@ -39,6 +40,9 @@
 
 class SimpleXHTMLWidgetEscapedText(Label):
 
+    def on_parent(self, instance, parent):
+        self.font_size = parent.font_size
+
     def _addUrlMarkup(self, text):
         text_elts = []
         idx = 0
@@ -79,7 +83,9 @@
 
 
 class SimpleXHTMLWidgetText(Label):
-    pass
+
+    def on_parent(self, instance, parent):
+        self.font_size = parent.font_size
 
 
 class SimpleXHTMLWidgetImage(AsyncImage):
@@ -139,6 +145,7 @@
     # XXX: bold is only used for escaped text
     bold = properties.BooleanProperty(False)
     content_width = properties.NumericProperty(0)
+    font_size = properties.NumericProperty(sp(14))
 
     # text/XHTML input