[gnome-panel/gtk3] panel: Do not overwrite opacity on gconf change notification for color



commit a74630d75c521ffa241e1afe3b186bce66f7c38a
Author: Vincent Untz <vuntz gnome org>
Date:   Mon Jan 31 20:06:16 2011 +0100

    panel: Do not overwrite opacity on gconf change notification for color
    
    Yes, we save rgba, and we still keep opacity in a different key. We're
    amazing.

 gnome-panel/panel-profile.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gnome-panel/panel-profile.c b/gnome-panel/panel-profile.c
index 4a4a68e..539830c 100644
--- a/gnome-panel/panel-profile.c
+++ b/gnome-panel/panel-profile.c
@@ -479,7 +479,7 @@ panel_profile_get_background_color (PanelToplevel *toplevel,
 
         key = panel_profile_get_toplevel_key (toplevel, "background/color");
         color_str = gconf_client_get_string (client, key, NULL);
-        if (!color_str || !gdk_rgba_parse(color, color_str)) {
+        if (!color_str || !gdk_rgba_parse (color, color_str)) {
                 color->red   = 0.;
                 color->green = 0.;
                 color->blue  = 0.;
@@ -1227,11 +1227,18 @@ panel_profile_background_change_notify (GConfClient   *client,
 		if (value->type == GCONF_VALUE_STRING) {
 			GdkRGBA color;
 			const char *str;
+                        const GdkRGBA *bg_color;
 
 			str = gconf_value_get_string (value);
 
-			if (gdk_rgba_parse (&color, str))
+			if (gdk_rgba_parse (&color, str)) {
+				/* we save rgba nowadays, but the opacity
+				 * setting is still living in a different key
+				 */
+				bg_color = panel_background_get_color (background);
+				color.alpha = bg_color->alpha;
 				panel_background_set_color (background, &color);
+			}
 		}
 	} else if (!strcmp (key, "opacity")) {
 		if (value->type == GCONF_VALUE_INT) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]