annotate cagou/plugins/plugin_wid_contact_list.kv @ 219:9faccd140119

plugin contact list: refactoring: - contacts are now displayed in a grid - they can be filtered thanks to FilterBehaviour - use the new update system of QuickContactList - a new "add a contact" button is visible, but not implemented yet.
author Goffi <goffi@goffi.org>
date Sun, 24 Jun 2018 22:26:15 +0200
parents e1f6dab40eed
children e1a385a791cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
126
cd99f70ea592 global file reorganisation:
Goffi <goffi@goffi.org>
parents: 110
diff changeset
2 # Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org)
9
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
3
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This program is free software: you can redistribute it and/or modify
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # it under the terms of the GNU Affero General Public License as published by
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # the Free Software Foundation, either version 3 of the License, or
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # (at your option) any later version.
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
8
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # This program is distributed in the hope that it will be useful,
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # GNU Affero General Public License for more details.
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
13
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # You should have received a copy of the GNU Affero General Public License
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
16
219
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
17 #:import _ sat.core.i18n._
50
c45d6e9ec731 contact list: fixed contact list display
Goffi <goffi@goffi.org>
parents: 15
diff changeset
18
9
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
19 <ContactItem>:
219
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
20 size_hint: None, None
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
21 width: self.base_width
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
22 height: self.minimum_height
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
23 orientation: 'vertical'
9
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
24 Avatar:
219
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
25 id: avatar
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
26 size_hint: 1, None
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
27 height: dp(60)
9
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
28 source: root.data.get('avatar', app.default_avatar)
157
e1f6dab40eed contact list: fixed avatar stretching
Goffi <goffi@goffi.org>
parents: 126
diff changeset
29 allow_stretch: True
9
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
30 Label:
110
34dfe0e32064 contact list: text entered in header input do filtering in shown contacts
Goffi <goffi@goffi.org>
parents: 50
diff changeset
31 id: jid_label
219
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
32 size_hint: None, None
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
33 text_size: root.base_width, None
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
34 size: self.texture_size
9
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
35 text: root.jid
7b0a53d2afd3 contact list: first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
36 bold: True
219
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
37 valign: 'middle'
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
38 halign: 'center'
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
39
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
40 <ContactList>:
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
41 float_layout: float_layout
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
42 layout: layout
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
43 orientation: 'vertical'
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
44 BoxLayout:
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
45 size_hint: 1, None
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
46 height: dp(30)
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
47 Widget:
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
48 SymbolLabel:
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
49 symbol: 'plus-circled'
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
50 text: _("add a contact")
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
51 Widget:
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
52 FloatLayout:
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
53 id: float_layout
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
54 ScrollView:
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
55 size_hint: 1, 1
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
56 pos_hint: {'x': 0, 'y': 0}
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
57 do_scroll_x: False
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
58 scroll_type: ['bars', 'content']
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
59 bar_width: dp(6)
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
60 StackLayout:
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
61 id: layout
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
62 size_hint: 1, None
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
63 height: self.minimum_height
9faccd140119 plugin contact list: refactoring:
Goffi <goffi@goffi.org>
parents: 157
diff changeset
64 spacing: 0