Mercurial > libervia-desktop-kivy
comparison 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 |
comparison
equal
deleted
inserted
replaced
222:a676cb07c1cb | 223:9e5f9f0cee48 |
---|---|
13 | 13 |
14 # You should have received a copy of the GNU Affero General Public License | 14 # You should have received a copy of the GNU Affero General Public License |
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 |
17 #:import _ sat.core.i18n._ | 17 #:import _ sat.core.i18n._ |
18 #:import e kivy.utils.escape_markup | |
18 | 19 |
19 <AddContactMenu>: | 20 <AddContactMenu>: |
20 padding: dp(20) | 21 padding: dp(20) |
21 spacing: dp(10) | 22 spacing: dp(10) |
22 Label: | 23 Label: |
23 size_hint: 1, None | 24 size_hint: 1, None |
24 color: 1, 1, 1, 1 | 25 color: 1, 1, 1, 1 |
25 text: root.instructions | 26 text: _("Please enter new contact JID") |
26 text_size: root.width, None | 27 text_size: root.width, None |
27 size: self.texture_size | 28 size: self.texture_size |
28 halign: "center" | 29 halign: "center" |
29 bold: True | 30 bold: True |
30 TextInput: | 31 TextInput: |
35 Button: | 36 Button: |
36 size_hint: 1, None | 37 size_hint: 1, None |
37 height: sp(50) | 38 height: sp(50) |
38 text: _("add this contact") | 39 text: _("add this contact") |
39 on_release: root.addContact(contact_jid.text) | 40 on_release: root.addContact(contact_jid.text) |
41 Widget: | |
42 | |
43 | |
44 <DelContactMenu>: | |
45 padding: dp(20) | |
46 spacing: dp(10) | |
47 Avatar: | |
48 id: avatar | |
49 size_hint: 1, None | |
50 height: dp(60) | |
51 source: root.contact_item.data.get('avatar', app.default_avatar) | |
52 allow_stretch: True | |
53 Label: | |
54 size_hint: 1, None | |
55 color: 1, 1, 1, 1 | |
56 text: _("Are you sure you wand to remove [b]{name}[/b] from your contact list?").format(name=e(root.contact_item.jid)) | |
57 markup: True | |
58 text_size: root.width, None | |
59 size: self.texture_size | |
60 halign: "center" | |
61 BoxLayout: | |
62 Button: | |
63 background_color: 1, 0, 0, 1 | |
64 size_hint: 0.5, None | |
65 height: sp(50) | |
66 text: _("yes, remove it") | |
67 bold: True | |
68 on_release: root.do_delete_contact() | |
69 Button: | |
70 size_hint: 0.5, None | |
71 height: sp(50) | |
72 text: _("no, keep it") | |
73 on_release: root.hide() | |
40 Widget: | 74 Widget: |
41 | 75 |
42 | 76 |
43 <ContactItem>: | 77 <ContactItem>: |
44 size_hint: None, None | 78 size_hint: None, None |