comparison cagou/kv/common.kv @ 193:284cb5c467b0

core (common): split JidItem in 3 classes: - JidItem to only view an Entity - JidButton to allow to click - JidToggle to select
author Goffi <goffi@goffi.org>
date Wed, 23 May 2018 18:40:58 +0200
parents 11ff8cd93659
children 254481ba2bae
comparison
equal deleted inserted replaced
192:62198e00a2b7 193:284cb5c467b0
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 <JidItem>: 18 <JidItem>:
19 size_hint: None, None 19 size_hint: 1, None
20 height: dp(70) 20 height: dp(70)
21 canvas.before: 21 canvas.before:
22 Color: 22 Color:
23 rgba: 0.2, 0.2, 0.2, 1 23 rgba: self.bg_color
24 Rectangle: 24 Rectangle:
25 pos: self.pos 25 pos: self.pos
26 size: self.size 26 size: self.size
27 Image: 27 Image:
28 source: root.getImage(self) 28 source: root.getImage(self)
29 size_hint: None, None 29 size_hint: None, None
30 size: dp(64), dp(64) 30 size: dp(64), dp(64)
31 Label: 31 Label:
32 color: 1, 1, 1, 1 32 size_hint: 1, 1
33 text_size: self.size
34 color: root.color
33 bold: True 35 bold: True
34 text: root.jid 36 text: root.jid
35 text_size: self.size
36 halign: 'left' 37 halign: 'left'
37 valign: 'middle' 38 valign: 'middle'
38 padding_x: dp(20) 39 padding_x: dp(5)
39 40
41 <JidToggle>:
42 canvas.before:
43 Color:
44 rgba: self.selected_color if self.state == 'down' else self.bg_color
45 Rectangle:
46 pos: self.pos
47 size: self.size
40 48
41 <Symbol>: 49 <Symbol>:
42 font_name: app.expand('{media}/fonts/fontello/font/fontello.ttf') 50 font_name: app.expand('{media}/fonts/fontello/font/fontello.ttf')
43 text_size: self.size 51 text_size: self.size
44 font_size: self.width - self.margin 52 font_size: self.width - self.margin