# HG changeset patch # User Mikel Olasagasti Uranga # Date 1276551245 -7200 # Node ID e76f78009b7e7b24d0ec3f9954675d7fe13262c4 # Parent 4b4c573ce65990d9c338cbee84dfa9c13c11e0ba Add transparency to applet. Patch by woutersj@gmail.com diff -r 4b4c573ce65990d9c338cbee84dfa9c13c11e0ba -r e76f78009b7e7b24d0ec3f9954675d7fe13262c4 src/revelation-applet.in --- a/src/revelation-applet.in Sat Apr 25 17:43:13 2009 +0700 +++ b/src/revelation-applet.in Mon Jun 14 23:34:05 2010 +0200 @@ -186,6 +186,9 @@ self.hbox = ui.HBox(self.eventbox, self.entry) self.applet.add(self.hbox) + + # handle Gnome Panel background + self.applet.connect("change-background",self.panel_bg) self.applet.show_all() @@ -322,6 +325,29 @@ else: self.entry_show(data) + # Handle Gnome Panel background + def panel_bg(self, applet, bg_type, color, pixmap): + # Reset styles + rc_style = gtk.RcStyle() + self.applet.set_style(None) + self.eventbox.set_style(None) + self.entry.set_style(None) + + self.applet.modify_style(rc_style) + self.eventbox.modify_style(rc_style) + self.entry.modify_style(rc_style) + + if bg_type == gnomeapplet.PIXMAP_BACKGROUND: + style = self.applet.get_style() + style.bg_pixmap[gtk.STATE_NORMAL] = pixmap + self.applet.set_style(style) + self.eventbox.set_style(style) + self.entry.set_style(style) + if bg_type == gnomeapplet.COLOR_BACKGROUND: + self.applet.modify_bg(gtk.STATE_NORMAL, color) + self.eventbox.modify_bg(gtk.STATE_NORMAL, color) + self.entry.modify_bg(gtk.STATE_NORMAL, color) + ##### PRIVATE METHODS #####