From e1f36a8445d1851f15a396ba5488119c298e593d Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Sat, 19 Jun 2010 01:44:59 -0400 Subject: first pass at gtk3 version of libappindicator --- src/app-indicator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/app-indicator.c') diff --git a/src/app-indicator.c b/src/app-indicator.c index bc43e58..939ca9a 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -1270,7 +1270,7 @@ widget_notify_cb (GtkWidget *widget, { dbusmenu_menuitem_property_set_bool (child, DBUSMENU_MENUITEM_PROP_ENABLED, - GTK_WIDGET_IS_SENSITIVE (widget)); + gtk_widget_is_sensitive (widget)); } else if (pspec->name == g_intern_static_string ("label")) { @@ -1422,7 +1422,7 @@ container_iterate (GtkWidget *widget, dbusmenu_menuitem_property_set_bool (child, DBUSMENU_MENUITEM_PROP_ENABLED, - GTK_WIDGET_IS_SENSITIVE (widget)); + gtk_widget_is_sensitive (widget)); dbusmenu_menuitem_property_set_bool (child, DBUSMENU_MENUITEM_PROP_VISIBLE, gtk_widget_get_visible (widget)); -- cgit v1.2.3 From 3551eb170dd87fbe11148136813e1bb580b90604 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Wed, 6 Oct 2010 12:08:49 -0400 Subject: instead of always building gtk2 and gtk3, add a --with-gtk= flag to configure to specify which to build with --- src/app-indicator.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/app-indicator.c') diff --git a/src/app-indicator.c b/src/app-indicator.c index 939ca9a..a52a063 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -33,7 +33,11 @@ License version 3 and version 2.1 along with this program. If not, see #include #include +#ifdef HAVE_GTK3 +#include +#else #include +#endif #include "app-indicator.h" #include "app-indicator-enum-types.h" @@ -1194,13 +1198,17 @@ static void update_icon_name (DbusmenuMenuitem *menuitem, GtkImage *image) { + const gchar *icon_name = NULL; + if (gtk_image_get_storage_type (image) != GTK_IMAGE_ICON_NAME) return; + gtk_image_get_icon_name (image, &icon_name, NULL); + if (should_show_image (image)) dbusmenu_menuitem_property_set (menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME, - image->data.name.icon_name); + icon_name); else dbusmenu_menuitem_property_remove (menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME); @@ -1212,16 +1220,18 @@ update_stock_item (DbusmenuMenuitem *menuitem, GtkImage *image) { GtkStockItem stock; + gchar *stock_id = NULL; if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK) return FALSE; - gtk_stock_lookup (image->data.stock.stock_id, &stock); + gtk_image_get_stock (image, &stock_id, NULL); + gtk_stock_lookup (stock_id, &stock); if (should_show_image (image)) dbusmenu_menuitem_property_set (menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME, - image->data.stock.stock_id); + stock_id); else dbusmenu_menuitem_property_remove (menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME); -- cgit v1.2.3