aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-18 13:06:15 -0500
committerTed Gould <ted@gould.cx>2010-03-18 13:06:15 -0500
commitb839c8aadcbae01755f1bbaa812f96646a9ddf4a (patch)
treed7b8e465349dd986c3945d23cd01216036dfbff1
parent0be5c8bcef961b60a8748ebdc63adc9a98cb8aef (diff)
parentddee75aad38e1608998a4c7a5d9b10733d1d227a (diff)
downloadlibayatana-appindicator-b839c8aadcbae01755f1bbaa812f96646a9ddf4a.tar.gz
libayatana-appindicator-b839c8aadcbae01755f1bbaa812f96646a9ddf4a.tar.bz2
libayatana-appindicator-b839c8aadcbae01755f1bbaa812f96646a9ddf4a.zip
Sync to Ubuntu Desktop
-rw-r--r--debian/changelog8
-rw-r--r--src/libappindicator/app-indicator.c46
2 files changed, 47 insertions, 7 deletions
diff --git a/debian/changelog b/debian/changelog
index 108153d..6b7a0fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,10 @@
-indicator-application (0.0.16-0ubuntu1~ppa1) lucid; urgency=low
+indicator-application (0.0.16-0ubuntu2) lucid; urgency=low
+
+ * Backported upstream change to respect gtk "always-show-image" (lp: #528527)
+
+ -- Sebastien Bacher <seb128@ubuntu.com> Mon, 15 Mar 2010 16:39:09 +0100
+
+indicator-application (0.0.16-0ubuntu1) lucid; urgency=low
* Upstream release 0.0.16
* Use libindicator icon loading helper
diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c
index 5edc9fe..5689c11 100644
--- a/src/libappindicator/app-indicator.c
+++ b/src/libappindicator/app-indicator.c
@@ -1071,6 +1071,32 @@ menuitem_iterate (GtkWidget *widget,
}
}
+static gboolean
+should_show_image (GtkImage *image)
+{
+ GtkWidget *item;
+
+ item = gtk_widget_get_ancestor (GTK_WIDGET (image),
+ GTK_TYPE_IMAGE_MENU_ITEM);
+
+ if (item)
+ {
+ GtkSettings *settings;
+ gboolean gtk_menu_images;
+
+ settings = gtk_widget_get_settings (item);
+
+ g_object_get (settings, "gtk-menu-images", &gtk_menu_images, NULL);
+
+ if (gtk_menu_images)
+ return TRUE;
+
+ return gtk_image_menu_item_get_always_show_image (GTK_IMAGE_MENU_ITEM (item));
+ }
+
+ return FALSE;
+}
+
static void
update_icon_name (DbusmenuMenuitem *menuitem,
GtkImage *image)
@@ -1078,9 +1104,13 @@ update_icon_name (DbusmenuMenuitem *menuitem,
if (gtk_image_get_storage_type (image) != GTK_IMAGE_ICON_NAME)
return;
- dbusmenu_menuitem_property_set (menuitem,
- DBUSMENU_MENUITEM_PROP_ICON_NAME,
- image->data.name.icon_name);
+ if (should_show_image (image))
+ dbusmenu_menuitem_property_set (menuitem,
+ DBUSMENU_MENUITEM_PROP_ICON_NAME,
+ image->data.name.icon_name);
+ else
+ dbusmenu_menuitem_property_remove (menuitem,
+ DBUSMENU_MENUITEM_PROP_ICON_NAME);
}
/* return value specifies whether the label is set or not */
@@ -1095,9 +1125,13 @@ update_stock_item (DbusmenuMenuitem *menuitem,
gtk_stock_lookup (image->data.stock.stock_id, &stock);
- dbusmenu_menuitem_property_set (menuitem,
- DBUSMENU_MENUITEM_PROP_ICON_NAME,
- image->data.stock.stock_id);
+ if (should_show_image (image))
+ dbusmenu_menuitem_property_set (menuitem,
+ DBUSMENU_MENUITEM_PROP_ICON_NAME,
+ image->data.stock.stock_id);
+ else
+ dbusmenu_menuitem_property_remove (menuitem,
+ DBUSMENU_MENUITEM_PROP_ICON_NAME);
const gchar * label = dbusmenu_menuitem_property_get (menuitem,
DBUSMENU_MENUITEM_PROP_LABEL);