~jconti/recent-notifications/trunk

« back to all changes in this revision

Viewing changes to unity/MessageItem.py

  • Committer: Jason Conti
  • Date: 2011-04-26 21:19:50 UTC
  • Revision ID: jason.conti@gmail.com-20110426211950-jud51n6myc18oxzo
Setting most of the colors with a gtk rc style now, except RoundedBox, because I can't figure out how to get the background style color. Seems like it should be widget.style.bg[state] however that list is always empty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    RoundedBox.__init__(self)
38
38
 
39
39
    self.set_border_width(2)
 
40
    self.set_name("message_item")
40
41
 
41
42
    self._unread = True
42
43
 
67
68
    else:
68
69
      self._image_unread.set_from_pixbuf(pixbuf)
69
70
 
70
 
    color = Color("#fff")
71
 
 
72
71
    self._label_summary = create_label()
 
72
    self._label_summary.set_name("message_label")
73
73
    self._summary_hbox.pack_start(self._label_summary, True, True, 0)
74
74
 
75
75
    self._label_body = create_label()
 
76
    self._label_body.set_name("message_label")
 
77
    logger.debug("FG: {0}".format(self._label_body.style.fg))
76
78
    self._vbox.pack_start(self._label_body, True, True, 1)
77
79
 
78
80
    self._label_info = create_label()
 
81
    self._label_info.set_name("message_label")
79
82
    self._vbox.pack_start(self._label_info, False, False, 0)
80
83
    self.update_labels()
81
84
 
139
142
 
140
143
    return " ".join(result)
141
144
 
142
 
  def set_theme(self, theme):
143
 
    """Updates the message item theme"""
144
 
    fg = theme.get_item_foreground()
145
 
    bg = theme.get_item_background()
146
 
 
147
 
    fg.set_fg_normal(self._label_summary)
148
 
    fg.set_fg_normal(self._label_body)
149
 
    fg.set_fg_normal(self._label_info)
150
 
 
151
 
    self.set_color(bg)
152
 
 
153
145
  def update_image(self):
154
146
    """Updates the image"""
155
147
    try: