aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-08-24 16:13:32 -0500
committerTed Gould <ted@gould.cx>2011-08-24 16:13:32 -0500
commit531bfc8641760da80d50d6bd298b2c62f6d0ab42 (patch)
tree116d6a47f3d67f6de25a8ab559819d60f3486ef3 /libdbusmenu-gtk
parent7fa57530eacea8ffe878782a7d01fd03f4f061bd (diff)
parent706e27d92a13130cf9a47f644c147497a7241611 (diff)
downloadlibdbusmenu-531bfc8641760da80d50d6bd298b2c62f6d0ab42.tar.gz
libdbusmenu-531bfc8641760da80d50d6bd298b2c62f6d0ab42.tar.bz2
libdbusmenu-531bfc8641760da80d50d6bd298b2c62f6d0ab42.zip
* New upstream release (0.4.91).
* New upstream release (0.4.92). * Fix GTK 2 build for style properties * Fixed proxied menu events not getting returned (LP: #799878)
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/genericmenuitem.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c
index 1d2f958..7f837ee 100644
--- a/libdbusmenu-gtk/genericmenuitem.c
+++ b/libdbusmenu-gtk/genericmenuitem.c
@@ -178,7 +178,7 @@ get_hpadding (GtkWidget * widget)
/* Get the value to put in the span for the disposition */
static gchar *
-get_text_color (GenericmenuitemDisposition disposition, GtkStyleContext * context)
+get_text_color (GenericmenuitemDisposition disposition, GtkWidget * widget)
{
struct {const gchar * color_name; const gchar * default_color;} values[] = {
/* NORMAL */ { NULL, NULL},
@@ -187,11 +187,14 @@ get_text_color (GenericmenuitemDisposition disposition, GtkStyleContext * contex
/* ALERT */ { "error-color", "red"}
};
+#if GTK_CHECK_VERSION(3, 0, 0)
+ GtkStyleContext * context = gtk_widget_get_style_context(widget);
GdkRGBA color;
if (gtk_style_context_lookup_color(context, values[disposition].color_name, &color)) {
return g_strdup_printf("rgb(%d, %d, %d)", (gint)(color.red * 255), (gint)(color.green * 255), (gint)(color.blue * 255));
}
+#endif
return g_strdup(values[disposition].default_color);
}
@@ -212,7 +215,7 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label)
case GENERICMENUITEM_DISPOSITION_INFORMATIONAL:
case GENERICMENUITEM_DISPOSITION_WARNING:
case GENERICMENUITEM_DISPOSITION_ALERT: {
- gchar * color = get_text_color(GENERICMENUITEM(menu_item)->priv->disposition, gtk_widget_get_style_context(GTK_WIDGET(menu_item)));
+ gchar * color = get_text_color(GENERICMENUITEM(menu_item)->priv->disposition, GTK_WIDGET(menu_item));
local_label = g_markup_printf_escaped("<span fgcolor=\"%s\">%s</span>", color, in_label);
g_free(color);
break;