[goffice] Fix wrong palette swatch sizes, due to bug introduced in gtk 2.16.



commit 137a3061a4c3bdcd983da4b6a945b6ed069118ad
Author: Emmanuel Pacaud <emmanuel pacaud lapp in2p3 fr>
Date:   Tue Jun 30 16:05:12 2009 +0200

    Fix wrong palette swatch sizes, due to bug introduced in gtk 2.16.
    (see http://bugzilla.gnome.org/show_bug.cgi?id=585421)
    
    * goffice/gtk/go-palette.c (go_palette_menu_item_new): here.

 ChangeLog                |    7 +++++++
 goffice/gtk/go-palette.c |   15 ++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9317a42..335fe26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-30  Emmanuel Pacaud <emmanuel pacaud lapp in2p3 fr>
+
+	Fix wrong palette swatch sizes, due to bug introduced in gtk 2.16.
+	(see http://bugzilla.gnome.org/show_bug.cgi?id=585421)
+
+	* goffice/gtk/go-palette.c (go_palette_menu_item_new): here.
+
 2009-06-28  Andreas J. Guelzow  <aguelzow pyrshep ca>
 
 	* goffice/utils/go-format.c (go_format_output_date_to_odf): when we
diff --git a/goffice/gtk/go-palette.c b/goffice/gtk/go-palette.c
index 6d84d84..4556a97 100644
--- a/goffice/gtk/go-palette.c
+++ b/goffice/gtk/go-palette.c
@@ -269,10 +269,16 @@ cb_menu_item_activate (GtkWidget *item, GOPalette *palette)
 	g_signal_emit (palette, go_palette_signals[GO_PALETTE_ACTIVATE], 0, index);
 }
 
+static void
+cb_menu_item_toggle_size_request (GtkWidget *item, gint *requitision)
+{
+	*requitision = 1;
+}
+
 static GtkWidget *
 go_palette_menu_item_new (GOPalette *palette, int index)
 {
-	GtkWidget *swatch; 
+	GtkWidget *swatch;
 	GtkWidget *item;
 	GOPalettePrivate *priv = palette->priv;
 
@@ -286,8 +292,11 @@ go_palette_menu_item_new (GOPalette *palette, int index)
 		tip = priv->get_tooltip (index, priv->data);
 		go_widget_set_tooltip_text (item, tip);
 	}
-	
-	g_signal_connect (item, "activate", G_CALLBACK (cb_menu_item_activate), palette); 
+
+	g_signal_connect (item, "activate", G_CALLBACK (cb_menu_item_activate), palette);
+
+	/* Workaround for bug http://bugzilla.gnome.org/show_bug.cgi?id=585421 */
+	g_signal_connect (item, "toggle-size-request", G_CALLBACK (cb_menu_item_toggle_size_request), NULL);
 
 	return item;
 }



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