# HG changeset patch # User Goffi # Date 1553070584 -3600 # Node ID 444ba439530fe9ddeba8f97fbad84eaf977aa1c6 # Parent f5302d57fb09eda249c79fc9966f0d7d0cb75fec chat: moved transfer button to header_box diff -r f5302d57fb09 -r 444ba439530f cagou/plugins/plugin_wid_chat.kv --- a/cagou/plugins/plugin_wid_chat.kv Wed Mar 20 09:29:44 2019 +0100 +++ b/cagou/plugins/plugin_wid_chat.kv Wed Mar 20 09:29:44 2019 +0100 @@ -14,7 +14,6 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -#:import TransferMenu cagou.core.menu.TransferMenu #:import SimpleXHTMLWidget cagou.core.simple_xhtml.SimpleXHTMLWidget #:import _ sat.core.i18n._ #:import C cagou.core.constants.Const @@ -124,14 +123,6 @@ multiline: True hint_text: _(u"Enter your message here") on_text_validate: root.onSend(args[0]) - SymbolButton - # transfer button - size_hint: 1, None - symbol: "plus-circled" - size_hint: None, 1 - width: dp(30) - font_size: dp(25) - on_release: TransferMenu(callback=root.onTransferOK).show(self) : @@ -142,6 +133,15 @@ font_size: dp(25) on_release: self.message_input_box.send_text() +# Buttons added in header + +: + size_hint: None, 1 + symbol: "plus-circled" + width: dp(30) + font_size: dp(25) + color: 0.4, 0.4, 0.4, 1 + : size_hint: None, 1 diff -r f5302d57fb09 -r 444ba439530f cagou/plugins/plugin_wid_chat.py --- a/cagou/plugins/plugin_wid_chat.py Wed Mar 20 09:29:44 2019 +0100 +++ b/cagou/plugins/plugin_wid_chat.py Wed Mar 20 09:29:44 2019 +0100 @@ -40,6 +40,7 @@ from kivy.uix.dropdown import DropDown from kivy.core.window import Window from cagou import G +from cagou.core import menu log = logging.getLogger(__name__) @@ -166,6 +167,13 @@ pass +class TransferButton(SymbolButton): + chat = properties.ObjectProperty() + + def on_release(self, *args): + menu.TransferMenu(callback=self.chat.onTransferOK).show(self) + + class EncryptionMainButton(SymbolButton): def __init__(self, chat, **kwargs): @@ -380,6 +388,8 @@ self._hi_comp_dropdown = DropDown() self._hi_comp_allowed = True cagou_widget.CagouWidget.__init__(self) + transfer_btn = TransferButton(chat=self) + self.headerInputAddExtra(transfer_btn) if type_ == C.CHAT_ONE2ONE: self.encryption_btn = EncryptionMainButton(self) self.headerInputAddExtra(self.encryption_btn)