Mercurial > libervia-desktop-kivy
annotate cagou/plugins/plugin_wid_contact_list.kv @ 221:e1a385a791cc
plugin contact list: implemented contact addition
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 26 Jun 2018 07:36:11 +0200 |
parents | 9faccd140119 |
children | 9e5f9f0cee48 |
rev | line source |
---|---|
9 | 1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client |
126 | 2 # Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org) |
9 | 3 |
4 # This program is free software: you can redistribute it and/or modify | |
5 # it under the terms of the GNU Affero General Public License as published by | |
6 # the Free Software Foundation, either version 3 of the License, or | |
7 # (at your option) any later version. | |
8 | |
9 # This program is distributed in the hope that it will be useful, | |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 # GNU Affero General Public License for more details. | |
13 | |
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/>. | |
16 | |
219 | 17 #:import _ sat.core.i18n._ |
50
c45d6e9ec731
contact list: fixed contact list display
Goffi <goffi@goffi.org>
parents:
15
diff
changeset
|
18 |
221
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
19 <AddContactMenu>: |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
20 padding: dp(20) |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
21 spacing: dp(10) |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
22 Label: |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
23 size_hint: 1, None |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
24 color: 1, 1, 1, 1 |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
25 text: root.instructions |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
26 text_size: root.width, None |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
27 size: self.texture_size |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
28 halign: "center" |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
29 bold: True |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
30 TextInput: |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
31 id: contact_jid |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
32 size_hint: 1, None |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
33 height: sp(30) |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
34 hint_text: _("enter here your new contact JID") |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
35 Button: |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
36 size_hint: 1, None |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
37 height: sp(50) |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
38 text: _("add this contact") |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
39 on_release: root.addContact(contact_jid.text) |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
40 Widget: |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
41 |
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
42 |
9 | 43 <ContactItem>: |
219 | 44 size_hint: None, None |
45 width: self.base_width | |
46 height: self.minimum_height | |
47 orientation: 'vertical' | |
9 | 48 Avatar: |
219 | 49 id: avatar |
50 size_hint: 1, None | |
51 height: dp(60) | |
9 | 52 source: root.data.get('avatar', app.default_avatar) |
157
e1f6dab40eed
contact list: fixed avatar stretching
Goffi <goffi@goffi.org>
parents:
126
diff
changeset
|
53 allow_stretch: True |
9 | 54 Label: |
110
34dfe0e32064
contact list: text entered in header input do filtering in shown contacts
Goffi <goffi@goffi.org>
parents:
50
diff
changeset
|
55 id: jid_label |
219 | 56 size_hint: None, None |
57 text_size: root.base_width, None | |
58 size: self.texture_size | |
9 | 59 text: root.jid |
60 bold: True | |
219 | 61 valign: 'middle' |
62 halign: 'center' | |
63 | |
221
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
64 |
219 | 65 <ContactList>: |
66 float_layout: float_layout | |
67 layout: layout | |
68 orientation: 'vertical' | |
69 BoxLayout: | |
70 size_hint: 1, None | |
71 height: dp(30) | |
72 Widget: | |
73 SymbolLabel: | |
74 symbol: 'plus-circled' | |
75 text: _("add a contact") | |
221
e1a385a791cc
plugin contact list: implemented contact addition
Goffi <goffi@goffi.org>
parents:
219
diff
changeset
|
76 on_release: root.addContactMenu() |
219 | 77 Widget: |
78 FloatLayout: | |
79 id: float_layout | |
80 ScrollView: | |
81 size_hint: 1, 1 | |
82 pos_hint: {'x': 0, 'y': 0} | |
83 do_scroll_x: False | |
84 scroll_type: ['bars', 'content'] | |
85 bar_width: dp(6) | |
86 StackLayout: | |
87 id: layout | |
88 size_hint: 1, None | |
89 height: self.minimum_height | |
90 spacing: 0 |