From bd7b4bc0353120f7b4cbf692cb51c306a50c62f1 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 11 Apr 2006 21:04:38 +0000 Subject: [PATCH] use STATE_PRELIGHT colors for group rows and STATE_ACTIVE for account rows --- src/roster_window.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index 35d99d946..0f8e1b142 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2755,13 +2755,13 @@ _('If "%s" accepts this request you will know his or her status.') % jid) gajim.config.set('showoffline', not gajim.config.get('showoffline')) self.draw_roster() - def set_renderer_color(self, renderer, set_background = True): + def set_renderer_color(self, renderer, style, set_background = True): '''set style for treeview cell, using PRELIGHT system color''' if set_background: - bgcolor = self.tree.style.bg[gtk.STATE_ACTIVE] + bgcolor = self.tree.style.bg[style] renderer.set_property('cell-background-gdk', bgcolor) else: - fgcolor = self.tree.style.fg[gtk.STATE_ACTIVE] + fgcolor = self.tree.style.fg[style] renderer.set_property('foreground-gdk', fgcolor) def iconCellDataFunc(self, column, renderer, model, iter, data = None): @@ -2772,14 +2772,14 @@ _('If "%s" accepts this request you will know his or her status.') % jid) if color: renderer.set_property('cell-background', color) else: - self.set_renderer_color(renderer) + self.set_renderer_color(renderer, gtk.STATE_ACTIVE) renderer.set_property('xalign', 0) elif model[iter][C_TYPE] == 'group': color = gajim.config.get_per('themes', theme, 'groupbgcolor') if color: renderer.set_property('cell-background', color) else: - self.set_renderer_color(renderer) + self.set_renderer_color(renderer, gtk.STATE_PRELIGHT) renderer.set_property('xalign', 0.2) else: jid = model[iter][C_JID].decode('utf-8') @@ -2809,12 +2809,12 @@ _('If "%s" accepts this request you will know his or her status.') % jid) if color: renderer.set_property('foreground', color) else: - self.set_renderer_color(renderer, False) + self.set_renderer_color(renderer, gtk.STATE_ACTIVE, False) color = gajim.config.get_per('themes', theme, 'accountbgcolor') if color: renderer.set_property('cell-background', color) else: - self.set_renderer_color(renderer) + self.set_renderer_color(renderer, gtk.STATE_ACTIVE) renderer.set_property('font', gtkgui_helpers.get_theme_font_for_option(theme, 'accountfont')) renderer.set_property('xpad', 0) @@ -2824,12 +2824,12 @@ _('If "%s" accepts this request you will know his or her status.') % jid) if color: renderer.set_property('foreground', color) else: - self.set_renderer_color(renderer, False) + self.set_renderer_color(renderer, gtk.STATE_PRELIGHT, False) color = gajim.config.get_per('themes', theme, 'groupbgcolor') if color: renderer.set_property('cell-background', color) else: - self.set_renderer_color(renderer) + self.set_renderer_color(renderer, gtk.STATE_PRELIGHT) renderer.set_property('font', gtkgui_helpers.get_theme_font_for_option(theme, 'groupfont')) renderer.set_property('xpad', 4) @@ -2867,13 +2867,13 @@ _('If "%s" accepts this request you will know his or her status.') % jid) if color: renderer.set_property('cell-background', color) else: - self.set_renderer_color(renderer) + self.set_renderer_color(renderer, gtk.STATE_ACTIVE) elif model[iter][C_TYPE] == 'group': color = gajim.config.get_per('themes', theme, 'groupbgcolor') if color: renderer.set_property('cell-background', color) else: - self.set_renderer_color(renderer) + self.set_renderer_color(renderer, gtk.STATE_PRELIGHT) else: # contact jid = model[iter][C_JID].decode('utf-8') account = model[iter][C_ACCOUNT].decode('utf-8')