Mercurial > libervia-desktop-kivy
diff cagou/plugins/plugin_wid_contact_list.kv @ 223:9e5f9f0cee48
plugin contact list: use new TouchMenuBehaviour to implement contact deletion
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 26 Jun 2018 20:27:23 +0200 |
parents | e1a385a791cc |
children | 03d74435c01c |
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_contact_list.kv Tue Jun 26 20:26:21 2018 +0200 +++ b/cagou/plugins/plugin_wid_contact_list.kv Tue Jun 26 20:27:23 2018 +0200 @@ -15,6 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. #:import _ sat.core.i18n._ +#:import e kivy.utils.escape_markup <AddContactMenu>: padding: dp(20) @@ -22,7 +23,7 @@ Label: size_hint: 1, None color: 1, 1, 1, 1 - text: root.instructions + text: _("Please enter new contact JID") text_size: root.width, None size: self.texture_size halign: "center" @@ -40,6 +41,39 @@ Widget: +<DelContactMenu>: + padding: dp(20) + spacing: dp(10) + Avatar: + id: avatar + size_hint: 1, None + height: dp(60) + source: root.contact_item.data.get('avatar', app.default_avatar) + allow_stretch: True + Label: + size_hint: 1, None + color: 1, 1, 1, 1 + text: _("Are you sure you wand to remove [b]{name}[/b] from your contact list?").format(name=e(root.contact_item.jid)) + markup: True + text_size: root.width, None + size: self.texture_size + halign: "center" + BoxLayout: + Button: + background_color: 1, 0, 0, 1 + size_hint: 0.5, None + height: sp(50) + text: _("yes, remove it") + bold: True + on_release: root.do_delete_contact() + Button: + size_hint: 0.5, None + height: sp(50) + text: _("no, keep it") + on_release: root.hide() + Widget: + + <ContactItem>: size_hint: None, None width: self.base_width