diff 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
line wrap: on
line diff
--- a/cagou/kv/common.kv	Tue May 22 19:25:23 2018 +0200
+++ b/cagou/kv/common.kv	Wed May 23 18:40:58 2018 +0200
@@ -16,11 +16,11 @@
 
 
 <JidItem>:
-    size_hint: None, None
+    size_hint: 1, None
     height: dp(70)
     canvas.before:
         Color:
-            rgba: 0.2, 0.2, 0.2, 1
+            rgba: self.bg_color
         Rectangle:
             pos: self.pos
             size: self.size
@@ -29,14 +29,22 @@
         size_hint: None, None
         size: dp(64), dp(64)
     Label:
-        color: 1, 1, 1, 1
+        size_hint: 1, 1
+        text_size: self.size
+        color: root.color
         bold: True
         text: root.jid
-        text_size: self.size
         halign: 'left'
         valign: 'middle'
-        padding_x: dp(20)
+        padding_x: dp(5)
 
+<JidToggle>:
+    canvas.before:
+        Color:
+            rgba: self.selected_color if self.state == 'down' else self.bg_color
+        Rectangle:
+            pos: self.pos
+            size: self.size
 
 <Symbol>:
     font_name: app.expand('{media}/fonts/fontello/font/fontello.ttf')