Permalink
Browse files

Example 43: Set a background color attribute on the BuddyListItem.

Alternate rows get different dark background colors.
  • Loading branch information...
1 parent e533013 commit ab56e90c2918340b0bbf932f195e80f3cddddb9d Dusty Phillips committed Jul 11, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 orkiv/__main__.py
View
@@ -67,6 +67,7 @@ class BuddyListItem(BoxLayout):
full_name = StringProperty()
status_message = StringProperty()
online_status = StringProperty()
+ background = ObjectProperty()
class BuddyList(BoxLayout):
@@ -94,6 +95,11 @@ def roster_converter(self, index, jabberid):
result['status_message'] = ""
result['online_status'] = "offline"
+ if index % 2:
+ result['background'] = (0, 0, 0, 1)
+ else:
+ result['background'] = (0.05, 0.05, 0.07, 1)
+
return result

0 comments on commit ab56e90

Please sign in to comment.