Commit 70319df9 authored by Tijmen de Mes's avatar Tijmen de Mes

Added loading screen to chat widget

parent f832e5ee
...@@ -644,6 +644,7 @@ class ChatWidget(base_class, ui_class): ...@@ -644,6 +644,7 @@ class ChatWidget(base_class, ui_class):
done_all_icon = IconDescriptor(Resources.get('icons/done-all.svg')) done_all_icon = IconDescriptor(Resources.get('icons/done-all.svg'))
chat_template = open(Resources.get('chat/template.html')).read() chat_template = open(Resources.get('chat/template.html')).read()
loading_template = open(Resources.get('chat/loading.html')).read()
image_data_re = re.compile(r"data:(?P<type>image/.+?);base64,(?P<data>.*)", re.I|re.U) image_data_re = re.compile(r"data:(?P<type>image/.+?);base64,(?P<data>.*)", re.I|re.U)
...@@ -659,6 +660,7 @@ class ChatWidget(base_class, ui_class): ...@@ -659,6 +660,7 @@ class ChatWidget(base_class, ui_class):
self.user_icons_css_class = 'show-icons' if blink_settings.chat_window.show_user_icons else 'hide-icons' self.user_icons_css_class = 'show-icons' if blink_settings.chat_window.show_user_icons else 'hide-icons'
self.chat_view.setHtml(self.chat_template.format(base_url=FileURL(self.style.path)+'/', style_url=self.style_variant+'.style', font_family=self.font_family, font_size=self.font_size)) self.chat_view.setHtml(self.chat_template.format(base_url=FileURL(self.style.path)+'/', style_url=self.style_variant+'.style', font_family=self.font_family, font_size=self.font_size))
self.chat_element = self.chat_view.page().mainFrame().findFirstElement('#chat') self.chat_element = self.chat_view.page().mainFrame().findFirstElement('#chat')
self.loading_element = self.chat_view.page().mainFrame().findFirstElement('#loading')
self.composing_timer = QTimer() self.composing_timer = QTimer()
self.last_message = None self.last_message = None
self.session = session self.session = session
......
...@@ -20,12 +20,18 @@ ...@@ -20,12 +20,18 @@
@import url("../../message_status_icons.style"); @import url("../../message_status_icons.style");
</style> </style>
<!-- The loading screen styles!-->
<style id="loading_style" type="text/css" media="screen,print">
@import url("../../loading.style");
</style>
<!-- The selected font !--> <!-- The selected font !-->
<style id="font_style" type="text/css" media="screen,print"> <style id="font_style" type="text/css" media="screen,print">
body {{ font: {font_size}px {font_family}; }} body {{ font: {font_size}px {font_family}; }}
</style> </style>
</head> </head>
<body> <body>
<div id="loading"></div>
<div id="chat"></div> <div id="chat"></div>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment