[goffice] Add alpha suppor to GOActionComboColor.



commit f63111557a43548cc0555b3c97db677573e9afce
Author: Jean Brefort <jean brefort normalesup org>
Date:   Wed Aug 1 08:53:12 2012 +0200

    Add alpha suppor to GOActionComboColor.

 ChangeLog                           |    7 +++++++
 goffice/gtk/go-action-combo-color.c |   14 ++++++++++++++
 goffice/gtk/go-action-combo-color.h |    2 +-
 3 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5c4e876..65aab91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-08-01  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/gtk/go-action-combo-color.c
+	(go_action_combo_color_create_tool_item),
+	(go_action_combo_color_set_allow_alpha): add alpha support.
+	* goffice/gtk/go-action-combo-color.h: ditto.
+
 2012-07-29  Jean Brefort  <jean brefort normalesup org>
 
 	* plugins/plot_surface/gog-xyz-surface-prefs.c
diff --git a/goffice/gtk/go-action-combo-color.c b/goffice/gtk/go-action-combo-color.c
index 60db6a0..78801b8 100644
--- a/goffice/gtk/go-action-combo-color.c
+++ b/goffice/gtk/go-action-combo-color.c
@@ -82,6 +82,7 @@ struct _GOActionComboColor {
 	GOColorGroup 	*color_group;
 	char		*default_val_label;
 	GOColor		 default_val, current_color;
+	gboolean	 allow_alpha;
 };
 typedef struct {
 	GtkActionClass base;
@@ -163,6 +164,7 @@ go_action_combo_color_create_tool_item (GtkAction *a)
 	if (icon) g_object_unref (icon);
 
 	go_combo_color_set_instant_apply (GO_COMBO_COLOR (tool->combo), TRUE);
+	go_combo_color_set_allow_alpha (GO_COMBO_COLOR (tool->combo), caction->allow_alpha);
 	go_combo_box_set_relief (GO_COMBO_BOX (tool->combo), GTK_RELIEF_NONE);
 	title = get_title (a);
 	go_combo_box_set_title (GO_COMBO_BOX (tool->combo), title);
@@ -289,3 +291,15 @@ go_action_combo_color_set_color (GOActionComboColor *a, GOColor color)
 		if (GO_IS_TOOL_COMBO_COLOR (ptr->data))
 			go_combo_color_set_color (GO_TOOL_COMBO_COLOR (ptr->data)->combo, color);
 }
+
+void
+go_action_combo_color_set_allow_alpha (GOActionComboColor *a, gboolean allow_alpha)
+{
+	GSList *ptr = gtk_action_get_proxies (GTK_ACTION (a));
+
+	a->allow_alpha = allow_alpha;
+	for ( ; ptr != NULL ; ptr = ptr->next)
+		if (GO_IS_TOOL_COMBO_COLOR (ptr->data))
+			go_combo_color_set_allow_alpha (GO_TOOL_COMBO_COLOR (ptr->data)->combo, allow_alpha);
+}
+
diff --git a/goffice/gtk/go-action-combo-color.h b/goffice/gtk/go-action-combo-color.h
index 2d47cb7..ebadbb3 100644
--- a/goffice/gtk/go-action-combo-color.h
+++ b/goffice/gtk/go-action-combo-color.h
@@ -41,7 +41,7 @@ GOActionComboColor *
 void 	go_action_combo_color_set_group (GOActionComboColor *a, gpointer group_key);
 GOColor go_action_combo_color_get_color (GOActionComboColor *a, gboolean *is_default);
 void    go_action_combo_color_set_color (GOActionComboColor *a, GOColor color);
-
+void    go_action_combo_color_set_allow_alpha (GOActionComboColor *a, gboolean allow_alpha);
 G_END_DECLS
 
 #endif  /* _GO_ACTION_COMBO_COLOR_H_ */



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