comparison cagou/kv/common.kv @ 397:54f6a47cc60a

core (common): added a notifications counter on ContactButton and use it in JidSelector: A notifications counter is drawned above avatar if `nofifs` key is present and not empty in `data`. This is used in JidSelector to show counter when necessary with opened chats.
author Goffi <goffi@goffi.org>
date Sun, 09 Feb 2020 23:47:29 +0100
parents 841045d5a937
children f7476818f9fb
comparison
equal deleted inserted replaced
396:ae6f7fd1cb0e 397:54f6a47cc60a
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 17
18 <NotifLabel>:
19 background_color: 1, 0, 0, 1
20 size_hint: None, None
21 text_size: None, root.height
22 padding_x: sp(5)
23 size: self.texture_size
24 bold: True
25 canvas.before:
26 Color:
27 rgba: root.background_color
28 Ellipse:
29 size: self.size
30 pos: self.pos
31
32
18 <ContactItem>: 33 <ContactItem>:
19 size_hint: None, None 34 size_hint: None, None
20 width: self.base_width 35 width: self.base_width
21 height: self.minimum_height 36 height: self.minimum_height
22 orientation: 'vertical' 37 orientation: 'vertical'
23 Avatar: 38 avatar: avatar
24 id: avatar 39 avatar_layout: avatar_layout
40 FloatLayout:
41 id: avatar_layout
25 size_hint: 1, None 42 size_hint: 1, None
26 height: dp(60) 43 height: dp(60)
27 source: root.data.get('avatar') or app.default_avatar 44 Avatar:
28 allow_stretch: True 45 id: avatar
29 Label: 46 pos_hint: {'x': 0, 'y': 0}
30 id: jid_label 47 source: root.data.get('avatar') or app.default_avatar
31 size_hint: None, None 48 allow_stretch: True
32 text_size: root.base_width, None 49 BoxLayout:
33 size: self.texture_size 50 id: label_box
34 text: root.data.get('nick', root.jid.node or root.jid) 51 size_hint: 1, None
35 bold: True 52 height: self.minimum_height
36 valign: 'middle' 53 Label:
37 halign: 'center' 54 size_hint: 1, None
55 height: self.font_size + sp(5)
56 text_size: self.size
57 shorten: True
58 shorten_from: "right"
59 text: root.data.get('nick', root.jid.node or root.jid)
60 bold: True
61 valign: 'middle'
62 halign: 'center'
38 63
39 64
40 <JidItem>: 65 <JidItem>:
41 size_hint: 1, None 66 size_hint: 1, None
42 height: dp(68) 67 height: dp(68)