# HG changeset patch # User Goffi # Date 1472390865 -7200 # Node ID 6cf08d0ee4609e9ad41d7f6f1c930d70a8c607e7 # Parent bd3ecac18870fc62e2fced77fe588ae0dcc76556 chat: forbid scrolling on X axis + don't delete widget until explicitly requested (with force attribute) diff -r bd3ecac18870 -r 6cf08d0ee460 src/cagou/plugins/plugin_wid_chat.py --- a/src/cagou/plugins/plugin_wid_chat.py Sun Aug 28 15:27:42 2016 +0200 +++ b/src/cagou/plugins/plugin_wid_chat.py Sun Aug 28 15:27:45 2016 +0200 @@ -96,7 +96,7 @@ quick_chat.QuickChat.__init__(self, host, target, type_, occupants, subject, profiles=profiles) cagou_widget.CagouWidget.__init__(self) self.header_input.hint_text = u"You are talking with {}".format(target) - scroll_view = ScrollView(size_hint=(1,0.8), scroll_y=0) + scroll_view = ScrollView(size_hint=(1,0.8), scroll_y=0, do_scroll_x=False) self.messages_widget = MessagesWidget() scroll_view.add_widget(self.messages_widget) self.add_widget(scroll_view) @@ -165,6 +165,13 @@ G.host.bridge.discoInfos(jid_.domain, self.profile, callback=discoCb, errback=discoEb) + def onDelete(self, force=False): + if force==True: + return True + if len(list(G.host.widgets.getWidgets(self.__class__, self.target, profiles=self.profiles))) > 1: + # we don't keep duplicate widgets + return True + return False PLUGIN_INFO["factory"] = Chat.factory