Mercurial > libervia-desktop-kivy
comparison src/cagou/plugins/plugin_wid_chat.py @ 103:c601e3d40342
chat: display delivery receipt (with a green check mark)
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 09 Jan 2017 00:46:59 +0100 |
parents | 20251d926cc2 |
children | ce6ef88f2cff |
comparison
equal
deleted
inserted
replaced
102:20251d926cc2 | 103:c601e3d40342 |
---|---|
524 class MessageWidget(GridLayout): | 524 class MessageWidget(GridLayout): |
525 mess_data = properties.ObjectProperty() | 525 mess_data = properties.ObjectProperty() |
526 mess_xhtml = properties.ObjectProperty() | 526 mess_xhtml = properties.ObjectProperty() |
527 mess_padding = (dp(5), dp(5)) | 527 mess_padding = (dp(5), dp(5)) |
528 avatar = properties.ObjectProperty() | 528 avatar = properties.ObjectProperty() |
529 delivery = properties.ObjectProperty() | |
529 | 530 |
530 def __init__(self, **kwargs): | 531 def __init__(self, **kwargs): |
531 super(MessageWidget, self).__init__(**kwargs) | 532 super(MessageWidget, self).__init__(**kwargs) |
532 self.mess_data.widgets.add(self) | 533 self.mess_data.widgets.add(self) |
533 | 534 |
562 # self.mess_xhtml.text_size = (parent.width - padding_x, None) | 563 # self.mess_xhtml.text_size = (parent.width - padding_x, None) |
563 | 564 |
564 def update(self, update_dict): | 565 def update(self, update_dict): |
565 if 'avatar' in update_dict: | 566 if 'avatar' in update_dict: |
566 self.avatar.source = update_dict['avatar'] | 567 self.avatar.source = update_dict['avatar'] |
568 if 'status' in update_dict: | |
569 status = update_dict['status'] | |
570 self.delivery.text = u'\u2714' if status == 'delivered' else u'' | |
567 | 571 |
568 | 572 |
569 class MessageInputBox(BoxLayout): | 573 class MessageInputBox(BoxLayout): |
570 pass | 574 pass |
571 | 575 |